n = int(eval(input()))

ans = 0

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

    if i%3 !=0 and i%5!=0:

        ans +=i

print(ans)

import numpy as np

n = int(eval(input()))

a = np.arange(n+1)

a[::3] = 0

a[::5] = 0

print((np.sum(a)))

n = int(eval(input()))
ans = 0
for i in range(1, n + 1):
    if i % 3 != 0 and i % 5 != 0:
        ans += i
print(ans)

import numpy as np

n = int(eval(input()))
a = np.arange(n + 1)
a[::3] = 0
a[::5] = 0
print((np.sum(a)))

+import numpy as np + -ans = 0 -for i in range(1, n + 1): -    if i % 3 != 0 and i % 5 != 0: -        ans += i -print(ans) +a = np.arange(n + 1) +a[::3] = 0 +a[::5] = 0 +print((np.sum(a)))