Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Discovering Shazam's Superpowers

By aumit_se · Limits 1s, 512 MB

Billy Batson has got the superpower of Shazam recently. By speaking the magic word “Shazam” he can transform himself into a costumed adult with the powers of superhuman.

He doesn’t even know how powerful he is. Every day he is discovering his superpower. Shazam and his friend are giving a serial number of a power when Shazam discovering a new one (the first one is 1, the second one is 2, the third one is 3 and so on).

In a holiday Shazam and his friend have gone for a dinner and discuss his superpowers. Every power of him has not equal strength. Suddenly they notice that the powers have serial numbers divisible by 3 are most powerful than other powers. They called this powers as “Tripplet”. Isn’t it interesting?

Now you will be given serial numbers of N superpower of Shazam. You have to find out how many superpowers are Tripplet or how many of them are divisible by 3 .


The first line contains an integer N (1<=N<=100) – total superpowers of Shazam discovered till now.

Next line contains N integers, each of them is the serial number of superpower of shazam.


Print One integer – The number of “Tripplet”.


1    3    5    6

In the sample case, you are given 4 numbers. Among them 3 and 6 are divisible by 3. So the answer will be 2 .



    100% Solution Ratio

    joyislam1954Earliest, Oct '18

    RUET_SDZFastest, 0.0s

    Mili290Lightest, 0 B

    user.796221Shortest, 66B


    Login to submit