#C11250. Sum of Multiples of 3 or 5

    ID: 40546 Type: Default 1000ms 256MiB

Sum of Multiples of 3 or 5

Sum of Multiples of 3 or 5

Given a non-negative integer n, calculate the sum of all positive integers up to n that are divisible by either 3 or 5.

The problem can be formally described as finding the sum:

$$S = \sum_{i=1}^{n} \begin{cases} i, & \text{if } i\mod3=0 \text{ or } i\mod5=0 \\ 0, & \text{otherwise} \end{cases}$$

For example, when n is 10, the integers that are divisible by 3 or 5 are 3, 5, 6, 9 and their sum is 33.

inputFormat

The input consists of a single non-negative integer n provided via standard input.

outputFormat

Output a single integer representing the sum of all integers from 1 to n that are divisible by either 3 or 5. The result should be printed to standard output.

## sample
10
33