SDE Path

Sum of Multiples of 3 or 5 Below N

Easy

Sum of Multiples of 3 or 5 Below N

Add up the numbers below N that are divisible by 3 or 5.

Input format

One line with an integer N (1 to 10000).

Output format

Print the sum of every integer from 1 to N - 1 that is divisible by 3 or by 5.

Constraints

  • Values fit in a 64-bit signed integer
  • Trailing whitespace and a trailing newline are ignored by the judge

Read from stdin, write to stdout. Sample cases below show the exact format.

Sample cases

Example 1
Input
10
Expected output
23
Example 2
Input
16
Expected output
60