n=int(eval(input()))

ans=0



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

    if i % 15 == 0:

        pass

    elif i % 3 == 0:

        pass

    elif i % 5 == 0:

        pass

    else:

        ans=ans+i

print(ans)

import numpy as np

n=int(eval(input()))

a=np.arange(n+1,dtype=np.int64)

a[::3]=0

a[::5]=0

print((a.sum()))

n = int(eval(input()))
ans = 0
for i in range(1, n + 1):
    if i % 15 == 0:
        pass
    elif i % 3 == 0:
        pass
    elif i % 5 == 0:
        pass
    else:
        ans = ans + i
print(ans)

import numpy as np

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

+import numpy as np + -ans = 0 -for i in range(1, n + 1): -    if i % 15 == 0: -        pass -    elif i % 3 == 0: -        pass -    elif i % 5 == 0: -        pass -    else: -        ans = ans + i -print(ans) +a = np.arange(n + 1, dtype=np.int64) +a[::3] = 0 +a[::5] = 0 +print((a.sum()))