#K95242. Sum Divisible by Three and Five
Sum Divisible by Three and Five
Sum Divisible by Three and Five
You are given a list of integers. Your task is to calculate the sum of numbers that are divisible by both 3 and 5. In other words, you must sum all integers from the input that satisfy the condition:
\(x \text{ is divisible by } 15\)
If there are no such numbers, output 0.
inputFormat
The input is given in two lines.
The first line contains a single integer \(N\) which represents the number of integers in the list.
The second line contains \(N\) space-separated integers.
outputFormat
Output a single integer which is the sum of all numbers that are divisible by both 3 and 5 (i.e. divisible by 15).
## sample6
15 30 45 20 10 -15
75
</p>