N = int(eval(input()))

SUM = []

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

    if i % 3 == 0 or i % 5 ==0:

        pass

    else:

        SUM.append(i)



print((sum(SUM)))

N = int(eval(input()))

count = 0

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

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

    count += i

print(count)
N = int(eval(input()))
SUM = []
for i in range(1, N + 1):
    if i % 3 == 0 or i % 5 == 0:
        pass
    else:
        SUM.append(i)
print((sum(SUM)))

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

-SUM = [] +count = 0 -    if i % 3 == 0 or i % 5 == 0: -        pass -    else: -        SUM.append(i) -print((sum(SUM))) +    if not (i % 3 == 0 or i % 5 == 0): +        count += i +print(count)