N = int(eval(input()))

sum = 0

for i in range(1,N+1):

  if not(i % 3 == 0 or i % 5 == 0):

    sum += i

 

print(sum)
import itertools

import math

import fractions

import functools

n = int(eval(input()))

sum = 0

for i in range(1,n+1):

    if not (i % 3 == 0 or i % 5 == 0):

        sum += i

print(sum)
N = int(eval(input()))
sum = 0
for i in range(1, N + 1):
    if not (i % 3 == 0 or i % 5 == 0):
        sum += i
print(sum)

import itertools
import math
import fractions
import functools

n = int(eval(input()))
sum = 0
for i in range(1, n + 1):
    if not (i % 3 == 0 or i % 5 == 0):
        sum += i
print(sum)

-N = int(eval(input())) +import itertools +import math +import fractions +import functools + +n = int(eval(input())) -for i in range(1, N + 1): +for i in range(1, n + 1):