#abc162b. [abc162_b]FizzBuzz Sum
[abc162_b]FizzBuzz Sum
Problem Statement
Let us define the FizzBuzz sequence as follows:
- If both and divides , .
- If the above does not hold but divides , .
- If none of the above holds but divides , .
- If none of the above holds, .
Find the sum of all numbers among the first terms of the FizzBuzz sequence.
Constraints
Input
Input is given from Standard Input in the following format:
Output
Print the sum of all numbers among the first terms of the FizzBuzz sequence.
Sample Input 1
15
Sample Output 1
60
The first terms of the FizzBuzz sequence are:
$1,2,\\text{Fizz},4,\\text{Buzz},\\text{Fizz},7,8,\\text{Fizz},\\text{Buzz},11,\\text{Fizz},13,14,\\text{FizzBuzz}$
Among them, numbers are , and the sum of them is .
Sample Input 2
1000000
Sample Output 2
266666333332
Watch out for overflow.