Im taking a SMC test soon and was looking over a past paper, but had a little trouble with q13:

UKMT Senior Mathematical Challenge 2006 (scroll to q13)

I ended up with 30 after some time, but am also suspicious that the answer could be 36.

Either way, I would still like some kind of logical approach to tackle this problem as I rarely practice this kind of question.

Thanks.