peterverebics/CodeNet_Python_118 huggingface dataset:
N = int(input())

ans = 0

for i in range(1, N+1):
    if i % 3 == 0 or i % 5 == 0:
        ans += i

print(ans)
n=int(input())
s=0
for i in range(n):
  if not(i%3==0 or i%5==0):
    s+=i
print(s)
N=int(input())
s=(N*(N-1))/2-(int(N/3)*3+3)*int(N/3)/2-(int(N/5)*5+5)*int(N/5)/2+(int(N/15)*15+15)*int(N/15)/2


print(s)
N = int(input())

ans = 0

for i in range(1,N+1): #1からNまで
  print(i)
  if i%3!=0 and i%5!=0:
    ans += i
print(ans)
n = int(input())
ans = 0
for i in range(1,n):
  if(i%3!=0 and i%5 !=0):
    ans = ans + i
print (ans)
n = int(input())
ans = 0

for i in range(n):
    if i%15 == 0:continue
    elif i%3 == 0:continue
    elif i%5 == 0:continue
    else:ans += i

print(ans)
N=input()
N=int(N)
m=0
for i in range (1, N):
                if i%3==0:
                	m=m+0
                elif i%5==0:
                	m=m+0
                else:
                	m=m+i
print(m)
import math
num = int(input())
syou = math.floor(num/15)
amari = num % 15
sum = 0

list = [1,2,0,4,0,0,7,8,0,0,11,0,13,14,0]
if syou >=1:
    for x in range(syou):
        sum += 60 + 120 * x

    for i in range(amari):
        sum += list[i] + 15 * (syou)

    print(sum)

else:
    for d in range(num):
        sum += list[d]
    print(sum)
a = int(input())
j = 0
for i in range(a):
    if i%3!=0 and i%5!=0:
        j+=i
print(j)
N = int(input())
s = 0
for i in range(N):
    if i % 3 == 0 and i % 5 == 0:
        continue
    elif i % 3 == 0:
        continue
    elif i % 5 == 0:
        continue
    else:
        s += i
print(s)
#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
from fractions import gcd
from math import ceil, floor
sys.setrecursionlimit(10 ** 6)

def input():
    return sys.stdin.readline()[:-1]

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

if __name__ == '__main__':
    main()
n = int(input())

ans = 0
for i in range(n):
    if i % 3 != 0 and i % 5 != 0:
        ans += i
print(ans)
N = int(input())
#A = list(map(int, input().split()))
amount = (N+1) * N // 2
three = N // 3
three = (three + 1) * 3 * three // 2
five = N // 5
five = (five + 1) * 5 * five // 2
fifteen = N // 15
fifteen = (fifteen + 1) * 15 // 2
print(amount-three-five+fifteen)
print(sum([n for n in range(1, int(input())) if (n%3!=0) and (n%5!=0)]))
# input
n = int(input())
sum = 0
# judge
for i in range(n+1):
    if ((i % 15 == 0) or (i % 3 == 0) or (i % 5 == 0)):
        sum += i

# output
print(sum)
def FizzBuzzSum():
  N = int(input())
  sum=0
  for i in range(N):
    if i%3!=0 and i%5!=0:
      sum=sum+i
  return sum
print(FizzBuzzSum())
li=[]
n=int(input())
for i in range(n):
  if i%3!=0 and i%5!=0:
    li.append(i)
print(sum(li))
n = int(input())
x = 0
li = list(range(1,n))
for i in range(n - 1) :
    if li[i]  % 3 == 0 and li[i]  % 5 != 0:
        li[i] = "Fizz"
    
    elif li[i]  % 3 != 0 and li[i]  % 5 == 0: 
        li[i] = "Buzz"
    
    elif li[i]  % 3 == 0 and li[i]  % 5 == 0:
        li[i] = "FizzBuzz"
    
    else:
        x += li[i]
print(x)
n = int(input())
ans = 0

for i in range(1, n):
  if i % 3 == 0 or i % 5 == 0:
    continue
  else:
    ans += i

print(ans)
n = int(input())

sum = 0
for i in range(n):
    if i % 15 == 0:
        continue
    elif i % 3 == 0:
        continue
    elif i % 5 == 0:
        continue
    else:
        sum += i
print(sum)
N = int(input())
B = 0

for i in range(N):
    if i % 3 == 0:
        continue
    elif i % 5 == 0:
        continue
    else:
        B += i

print(B)
sum([i for i in range(1, 1+int(input())) if i%3 * i%5])
n = int(input())
s = 0
for i in range(1, n):
    if i % 3 != 0 and i % 5 != 0:
        s += i
print(s)
n = int(input())
ans = 0
for i in range(n):
    if not(i%3==0 or i%5==0):
        ans += i
print(ans)
n = int(input())

three = (3+(n//3)*3) * (n//3)/2
five = (5+(n//5)*5) * (n//5)/2
cup = (15+(n//15)*15) * (n//15)/2
total = (1+n) * n/2

ans = total - three - five + cup

print(ans)
N = input()
a = list()
for i in range (int(N)):
    if i % 3 == 0 or i % 5 == 0:
        continue
    a.append(i)
print(sum(a))
if __name__ == '__main__':
    N = int(input())
    ans = 0
    for i in range(N):
        if i%3 > 0 and i%5 > 0:
            ans += i
    print(ans)
n=int(input())
a=[i for i in range(n) if i%3!=0 and i%5!=0]
print(sum(a))
N=int(input())
ans=0
for i in range(N):
  if i%3!=0 and i%5!=0:
    ans+=i
print(ans)
N = int(input())
def fbn(n):
    return (x for x in range(n) if x % 3 and x % 5)
print(sum(fbn(N)))
n=int(input())
l=[]
for i in range(n+1):
    if i%3==0:
        pass
    elif i%5==0:
        pass
    elif i%15==0:
        pass
    else:
        l.append(i)
print('l',l)
        
print(sum(l))
n = int(input())
ans = 0
for i in range(n):
  if not (i % 3 == 0 or i % 5 == 0):
    ans += i

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

print(sum)
N = int(input())
sum = 0

for i in range(N):
  if i % 15 != 0 and i % 3 != 0 and i % 5 != 0:
    sum += i

print(sum)
n = int(input())

ans = 0
for i in range(n):
  if i % 3 != 0:
    if i % 5 != 0:
      if i % 15 != 0:
        ans = ans + i
print(ans)
n=int(input())
ans =0
for i in range(0,n):
   if  i % 3!=0 and i % 5!=0:
    ans += i
print(ans)
N=int(input())
count=0
i=1
A=0
for i in range(N):
    if i%3!=0 and i%5!=0:
        count+=1
        A+=i
print(A)
n = int(input())
num = 0
for x in range(n) :
  if x%3 != 0 and x%5 != 0 :
    num += x
print(num)
N = int(input())

cnt = 0
for i in range(1, N+1):
  if i%3!=0 or i%5!=0:
    cnt += i
print(i)
n = int(input())

lst_3 = list(range(n))
lst_5 = list(range(n))
lst_15 = list(range(n))
del lst_3[3::3]
del lst_5[5::5]
del lst_15[15::15]

lst = list(set(lst_3) & set(lst_5) & set(lst_15))
print(sum(lst))
N=1000000
n=N//15
ans=60*(n**2)
if N%15==1:
	ans+=(1+15*(n))
elif N%15==2 or N%15==3:
	ans+=(3+30*(n))
elif N%15==4 or N%15==5 or N%15==6:
	ans+=(7+45*(n))
elif N%15==7:
	ans+=(14+60*(n))
elif N%15==8 or N%15==9 or N%15==10:
	ans+=(22+75*(n))
elif N%15==11 or N%15==12:
	ans+=(33+90*(n))
elif N%15==13:
	ans+=(46+105*(n))
elif N%15==14:
	ans+=(60+120*(n))
print(ans)
N = int(input())

N_list = list(range(1, N + 1))

ans = 0

for i in N_list:
    if not i % 3 == 0 or i % 5 == 0:
        ans += i
print(ans)
n = int(input())
l=[]
for i in range(n+1): 
  if i%3==0:
    l.append(i)
  elif i%5==0:
    l.append(i)
print(sum(l))
a = int(input())
lists = [i+1 for i in range(a)]
for t in lists:
  if t % 5 == 0:
    lists.remove(t)
  elif t % 3 ==0:
    lists.remove(t)
    
print(sum(lists))
n=int(input())
s=0
for i in range(n):
  if(i%3!=0 and i%5!=0):
    s+=i
print(s)
N = int(input())

FB = []
for i in range(N):
    if i % 3 ==0 or i % 5 ==0:
        FB.append(0)
    else:
        FB.append(i)

print(sum(FB))
N = int(input())
n_list = [0 if (n % 15 == 0 or n % 3 == 0 or n % 5 == 0) else n for n in range(1,N)]
print(sum(n_list))
N = int(input())
ans = 0
for i in range(N):
    if i % 3 != 0 and i % 5 != 0:
        ans += i
print(ans)
N = int(input())
sum = 0
for i in range(N):
  if i % 3 != 0:
    if i % 5 != 0:
      sum += i
print(sum)
N=int(input())
f=0
for i in range(1,N+1):
    if i %15==0:
        print ("FizzBizz")
    if i%3==0:
        print("Fizz")
    if i%5==0:
        print("Buzz")
    else:
        print(i)
        f=f+i
print(f)
n = int(input())
list = []

for i in range(1, n + 1):
    if i % 3 == 0 and i % 5 == 0:
        print('FizzBuzz')
    elif i % 3 == 0:
        print('Fizz')
    elif i % 5 ==0 :
        print('Buzz')
    else:
        list.append(i)

print(sum(list))
N = int(input())
a = list()

for i in range(N):
    if i % 3 == 0:
        continue
    if i % 5 == 0:
        continue
    else:
        a.append(i)
# print(a)
print(sum(a))
N = int(input())

sum = 0
for i in range(N):
    j = i + 1
    if (j % 3 != 0) and (j % 5 != 0):
        print(j)
        sum += j

print(sum)
# printを残したままでもできるか。問題は和を求めたい。余計なものはNGになる。

number = int(input())
Total = []

for i in range(1, number + 1):
    if number % 3 == 0 and i % 5 == 0:
        print("FizzBuzz")
    elif i % 3 ==0:
        print("Fizz")
    elif i % 5 == 0:
        print("Buzz")
    else:
        Total.append(i)

print(sum(Total))
n = int(input())

cnt = 0
for i in range(n):
    if (i % 3 == 0) or (i % 5 == 0):
        pass
    else:
        cnt += i

print(cnt)
num = int(input())
a = [i for i in range(1,num)]
for f in a:
  if f % 3 == 0:
    del a[a.index(f)]
  elif f % 5 == 0:
    del a[a.index(f)]
print(sum(a))
N = int(input())
li = []
for i in range(N):
  if i % 3 != 0 and i % 5 != 0 :
    li.append(i)
print(sum(li))
# 1 <= N <= 1000000
N = int(input())

for i in range(0, N+1):
    if i % 15 == 0:
        print("FizzBuzz")
    elif i % 3 == 0:
        print("Fizz")
    elif i % 5 == 0:
        print("Buzz")
    else:
        print(i)


# 和を求める
def main():
  n = int(input())
  l = []
  a,b = 0,1
  for x in range(n):
    if x%15==0:
      pass
    elif x%5==0:
      pass
    elif x%3==0:
      pass
    else:
      l.append(x)
      
  print(sum(l))    


if __name__ == '__main__':
  main()
#!/usr/bin/env python3

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

a = [i for i in range(n) if i % 3 != 0 and i % 5 != 0]

print(sum(a))
n = int(input())
sum = 0

for i in range(n+1):
  if i%3!=0 or i%5!=0:
    sum+=i
    
print(sum)
n = int(input())
s = []
for i in range(n):
  if not i%3 and i%5==0:
       s.append(i)
print(sum(s))
N=int(input())
count = 0
for i in range(N):
    if (i+1)%5 == 0:
        count += i+1
    elif (i+1)%3 == 0:
        count += i+1
print(count)
a = int(input())
j = 0
for i in range(a):
    if i%3==0:
        continue
    if i%5==0:
        continue
    else:
        j+=i
print(j)
def main():
    i = int(input())
    print(sum([j for j in range(i) if j % 3 != 0 and j % 5 != 0]))


main()
n=int(input())

sum=0

for i in range(1,n):

    if (i%3 == 0) or  (i%5 == 0):
        continue
    else:
        sum=sum+i;
print(sum)
N=int(input())
A=[]
for i in range(N):
  if i%3!=0:
    if i%5!=0:
      A.append(i)
print(sum(A))
n = int(input())
all_sum = n * (n + 1)/2

number_3 = n//3
number_5 = n//5
number_15 = n//15

sum_number_3 = 3 * (number_3 * (number_3 + 1)/2)
sum_number_5 = 5 * (number_5 * (number_5 + 1)/2)
sum_number_15 = 15 * (number_15 * (number_15 + 1)/2)

sum_not_number = sum_number_3 + sum_number_5 - sum_number_15

s = all_sum - sum_not_number

print(s)
N = int(input())
ans = 0
for a in range(N):
    if a % 3 != 0 and a % 5 != 0:
        ans += a

print(ans)
n = int(input())
s = 0
for i in range(n):
  if i % 3 == 0:
    pass
  elif i % 5 == 0:
    pass
  else:
    s = s + i
print(s)
N = int(input())

x = 0

for i in range(N):
    if i % 15 == 0:
        #FB
        pass
    elif i % 3 == 0:
        #F
        pass
    elif i % 5 == 0:
        #B
        pass
    else:
        x += i

print(x)
N=int(input())
list=[]
for i in range(N):
    if i%3==0 and i%5==0:
        list.append("FizzBuzz")
    elif i%3==0 and i%5!=0:
        list.append("Fizz")
    elif i%3!=0 and i%5==0:
        list.append("Buzz")
    else:
        list.append(i)
count=0
for i in range(N):
    if list[i]!="FizzBuzz" and list[i]!="Fizz" and list[i]!="Buzz":
        count+=list[i]
print(count)
n = int(input())

sum = (1 + n) * n // 2

sho_3 = n // 3
sho_5 = n // 5
sho_15 = n // 15

s_3 = (sho_3 * 3 + 3) * sho_3 // 2
s_5 = (sho_5 * 5 + 5) * sho_5 // 2
s_15 = (sho_15 * 15 + 15) * sho_15 // 2

print(sum)
print(s_3)
print(s_5)
print(s_15)

print(sum - s_3 - s_5 + s_15)
n = int(input())

s = [i for i in range(1,n+1)]
print(sum(s))
#coding:utf-8
N=int(input())
fizz_buzz=list()
for i in range(1,N):
	if i%3==0 and i%5==0:
		fizz_buzz.append(0)
	elif i%3==0:
		fizz_buzz.append(0)
	elif i%5==0:
		fizz_buzz.append(0)
	else:
		fizz_buzz.append(i)

print(sum(fizz_buzz))
N = int(input())
j = 0
for i  in range(1,N + 1):
    if i % 3 == 0 and i % 5 == 0:
        print('FizzBuzz')
    elif i % 3 == 0:
        print('Fizz')
    elif i % 5 == 0:
        print('Buzz')
    else:
        print(i)
        j = j + i

print(j)
a = int(input())
sums = 0
for i in range(a):
  if (i+1)%3!=0 and (i+1)%5!=0:
    sums+=i
print(sums)
N=int(input())
ans=0
for i in range(N):
    if i%3!=0 and i%5!=0:
        ans+=i
print(str(ans))
N = int(input())

cnt = 0

for i in range(N-1):
    i +=1
    if i % 3 !=0  and i % 5 !=0:
        cnt += i

print(cnt)
N = int(input())  #スペース抜きの複数行,１文字ずつ
 
A = []
for i in range(1,N):
  if i % 3 == 0:
    A.append(0)
  elif i % 5 == 0:
    A.append(0)
  else:
    A.append(i)

print(sum(A))
n = int(input())

ans = 0

for i in range(n):
    if (i % 3 != 0) and (i % 5 != 0):
        ans += i
print(ans)
N = int(input())
sumnu = 0
if 1 <= N and N <= 10**6:
  for i in range(N):
    if not (i % 3 == 0 or i % 5 == 0):
      sumnu += i
print(sumnu)
n = int(input())

l=list(range(1,n+1))
print(l)

count=0

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

FizzBuzzlist = [i for i in range(N)]
FizzBuzzlist.remove(0)
for i in range(len(FizzBuzzlist)):
  if FizzBuzzlist[i]%3 ==0 and FizzBuzzlist[i]%5 ==0:
    #FizzBuzzlist[i] = "FizzBuzz"
    FizzBuzzlist[i] = 0
  elif FizzBuzzlist[i]%3 ==0:
    #FizzBuzzlist[i] = "Fizz"
    FizzBuzzlist[i] = 0
  elif FizzBuzzlist[i]%5 ==0:
    #FizzBuzzlist[i] = "Buzz"
    FizzBuzzlist[i] = 0

print (sum(FizzBuzzlist))
def main():
    n = int(input())
    s = 0
    for i in range(n):
        if i % 3 != 0 and i % 5 != 0:
            s += i
    print(s)


main()
n = int(input())

total = 0
Fizz_or_Buzz = False

for i in range(0, n):

    Fizz_or_Buzz = False

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

        if i % 3 == 0 :
            # print('Fizz')
            Fizz_or_Buzz = True
        if i % 5 == 0 :
            # print('Buzz')
            Fizz_or_Buzz = True

        if Fizz_or_Buzz == False :
            total = total + i

print(total)
n = int(input())
sum = 0
for i in range(1,n):
    if i%3==0 or i%5==0 or (i%5==0 and i%3==0):
        continue
    sum+=i
print(sum)
N = int(input())
sum_ = 0
for i in range(N):
  if i % 3 != 0 and i % 5 != 0:
    sum_ += i
print(sum_)
n=int(input())
ans=0
for i in range(n):
    if i%5==0:
        continue
    if i%3==0:
        continue
    ans+=i
print(ans)
def main():
    N = int(input())
    X = N // 15
    Y = N % 15
    m = [0, 1, 2, 0, 4, 0, 0, 7, 8, 0, 0, 11, 0, 13, 14, 0]
    cnt = [0, 1, 2, 2, 3, 3, 3, 4, 5, 5, 5, 6, 6, 7, 8]
    csm = [0, 1, 3, 3, 7, 7, 7, 14, 22, 22, 22, 33, 33, 33, 46, 60]
    ans = X * 60 + (X-1) * X // 2 * 120 + cnt[Y] * (15*X) + csm[Y]
    print(ans)


if __name__ == "__main__":
    main()
n = int(input())
ans = 0
for i in range(n):
  if (i % 3 != 0 and i % 5 != 0):
    ans += i
print(ans)
n = int(input())
sum = 0

for i in range(n):
    if i % 3 != 0 and i % 5 != 0:
        sum += i

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

for i in range(n):
    if not(((i % 3 == 0) and (i % 5 == 0)) or (i % 3 == 0) or(i % 5 == 0)):
        sum += i
    
print(sum)
import itertools
##print(ord("A"))
n = int(input())
ans = 0
for i in range(n):
    if i %3==0 or i%5==0:
        pass
    else:
        ans += i
        #print(i)
print(ans)
num = int(input())
li = [i for i in range(num)]
s = [li[i] for i in li if i % 3 == 0 or i % 5 == 0]
print(sum(li) - sum(s))
a = input()
count = 0
for i in range(int(a)):
    if i % 3 != 0 and i % 5 != 0 and i % 15 != 0:
        count += i

print(count)
n = int(input())

for i in range(1,n+1):
    if i % 15 == 0:
        print('Fizz Buzz')
    elif i % 3 == 0:
        print('Fizz')
    elif i % 5 == 0:
        print('Buzz')
    else:
        print(i)
N = int(input())
ans = 0
for n in range(1,N+1):
  if n%3 == 0 or N%3 == 0:
    pass
  else:
    ans += n
print(n)
s = input()
n=int(s)
ans=0
for i in range(n):
    if not (i%3==0 or i%5==0):  
        ans+=i
print(ans)
n=int(input())
s=0
for i in range(n):
    if i%3==0 and i%5==0:
      continue
    elif i%3==0 and i%5!=0:
      continue
    elif i%3!=0 and i%5==0:
      continue
    else:
      s += i
print(s)
n = int(input())
ans = 0

for i in range(n):
	if i%3 == 0 or i%5 == 0:
		ans += 0
	else:
		ans += i
print(ans)
def main():
    n = int(input())
    a = 0
    for i in range(1,n):
        if not (i%3 == 0 or i%5 == 0):
            a += i
    print(a)

if __name__ == "__main__":
    main()
def fizz_buzz_sum(N):
  not_fb = [i for i in range(N) if (i%3 != 0) and (i%5 != 0)]
  return sum(not_fb)

print(fizz_buzz_sum(int(input())))
num = int(input())
list = []
for i in range(num):
  if i % 15 == 0 or i%3 == 0 or i%5 == 0:
    continue
  else :
    list.append(i)
    
result = 0
for item in list:
  result += item

print(result)
n = int(input())
ans = 0
for i in range(1, n):
	if i % 3 != 0 and i % 5 != 0:
		ans += i
print(ans)
N = int(input())
sum = 0
for i in range(N):
  if i % 3 != 0 or i % 5 != 0:
    sum += i
print(sum)
A = int(input())
B = 0

for i in range(A):
    if i % 3 != 0 and i % 5 != 0 :
       B = B + i   

print(B)
n = int(input())

a = n//15
b = n//3
c = n//5

d = n*(1+n)/2-b*(1+b)/2*3-c*(1+c)/2*5+a*(1+a)*15
print(d)
n=int(input())
total=0
for i in range(n):
  if i%3!=0 and i%5!=0:
    total=total+i
print(total)
n = int(input())
ans = 0
for i in range(n):
    if i%15 == 0:
        continue
    elif i%3 == 0:
        continue
    elif i%5 == 0:
        continue
    else:
        ans += i
print(ans)
n = int(input())
n = range(1,n)
x = list()

for i in n:
    m = i % 3
    if m != 0:
        m = i % 5
        if m != 0:
            x.append(i)

print(sum(x))
from collections import deque

N = int(input())

q = deque()

for a in range(N):
    if a%5 == 0 and a%3 == 0:
        continue
    elif a%5 == 0:
        continue
    elif a%3 == 0:
        continue
    else:
        q.append(a)

sm = sum(q)
print(sm)
N = int(input())
x=0
for i in range(1,1+N):
  if N % 3 != 0 or N%5 !=0:
    x = x + i
print(x)
n = int(input())
ans = 0
for i in range(1, n+1):
    if i%3 == 0 or i%5 == 0:
        ans += i
print(ans)
N = int(input())
ans = 0
for i in range(N):
    if i%15 != 0 and i%3 != 0 and i%5 != 0:
        #print(i)
        ans += i
print(ans)
a = (int(input()) + 1)
ans = 0

for i in range(1, a):
    if i % 15 == 0:
        ans += i
    elif i % 3 == 0:
        ans += i
    elif i % 5 == 0:
        ans += i

print(ans)
N = int(input())
ans = 0
for num in range(N):
    if (num % 3 != 0) and (num % 5 != 0):
        ans = ans + num
print(ans)
n = int(input())
j = 0
for i in range(n):
    if i % 3 == 0 or i%5 == 0:
        j += 0
    else:
        j += i
print(j)
N = int(input())

L = []
for i in range(1, N+1):
    if i % 3 ==0 and i % 5 ==0:
        L.append(i)
    elif i%3==0:
        L.append(i)
    elif i%5==0:
        L.append(i)

print(sum(L))
n = int(input())
A = list(range(1, n+1))
B = list()
for i in range(1, n+1):
    if i % 5 == 0 or i % 3 == 0:
        continue
    B.append(i)
ans = list(set(A) - set(B))
print(sum(ans))
n = int(input())
a=n*(n+1)
b=n//3
c=n//5
d=n//15
print(a-b-c+d)
n = int(input())

a = []

for i in range(n):
    if (i % 5 == 0) and (i % 3 == 0):
        continue
    elif i % 5==0:
        continue
    elif i % 3 ==0:
        continue
    else:
        a.append(i)
    
ans = sum(a)

print(ans)
n = int(input())
ans = 0
for i in range(n):
  if i%3==0 or i%5==0 or i%15==0:
    ans = ans
  else:
    ans =ans+i

print(ans)
N = int(input())
ans = 0
for i in range(N):
    if (not i%3 == 0) and (not i%5 == 0):
        ans += i
print(ans)
n = input()
kei = 0

for i in range(int(n)):
    if i%3 != 0 and i%5 != 0:
        kei += i

print(kei)
N = int(input())

Not_Fizzbuzz = []

for i in range(N):
    if i % 3 == 0 and i % 5 == 0:
        pass
    elif i % 3 == 0:
        pass
    elif i % 5 == 0:
        pass
    else:
        Not_Fizzbuzz.append(i)


print(sum(Not_Fizzbuzz))
N = int(input())
ans = 0
for i in range(N):
  if i % 3 != 0 and i % 5 != 0:
    ans += i
print(ans)
# coding: utf-8
# Your code here!

def main():
    number = int(input())
    answear = sum([result for result in range(number) if result % 3 != 0 and result % 5 != 0])
    print(answear)
if __name__ == "__main__":
    main()
n = int(input())
sum = 0
for x in range(n):
  if x%3 == 0 or x%5 ==0:
    pass
  else:
    sum = sum + x
print(sum)
N = int(input())
li = 0
for i in range(N):
  if i % 3 != 0 and i % 5 != 0 :
    li += i
print(li)
x = int(input())
N = 0

for i in range(x):
    if i%3==0 and i%5==0:
        pass
    elif i%3==0:
        pass
    elif i%5==0:
        pass
    else:
        N = i + N
        
print(N)
n=int(input())
x=0
for i in range(0,n):
  if i%3==0 or i%5==0:
    x=x
  else:
    x=x+i

print(x)
n = int(input())
sum = 0
for i in range(n):
    if ((not i % 3 == 0) and (not i % 5 == 0)):
        sum += i
print(sum)
def fizzbuzz_sum(n):
    result = 0
    for num in range(n):
        rn = num+1
        if rn % 3 == 0 or rn % 5 == 0:
            result += rn
    return result

n = int(input())
print(fizzbuzz_sum(n))
N = int(input())
totale = 0 
 
for i in range(1, N): 
     if (i % 3 == 0) or (i % 5 == 0): 
         continue
     else:
         totale += i
 
print(totale)
N = int(input())

ans = 0

for i in range(N):
  if i % 3 != 0 or i % 5 != 0:
    ans += i
    
print(ans)
# 1 <= N <= 1000000
N = int(input())

total = []

for x in range(1, N+1):
    if not(x % 15 == 0 or x % 5 == 0 or x % 3 == 0):
        total.append(x)
        print(sum(total))
n = int(input())

s = 0

for i in range(n):
	if i % 3 != 0:
		if i % 5 != 0:
			s = s + i

print(s)
n = int(input())
a = 0
for i in range(n):
    if i%3 == 0 or i%5 == 0:
        a += 0
    else:
        a +=i
print(a)
N = int(input())
ns = set()
for i in range(N):
    if not(i%3==0 or i%5==0):
        ns.add(i)
print(sum(ns))
N = int (input())
sum = 0
for i in range (N):
    if i % 3 == 0 and i % 5 == 0: continue
    elif i % 3 == 0: continue
    elif i % 5 == 0: continue
    else: sum += i 
print (sum)
N = int(input())
result = 0
for i in range(1, N):
    if i % 3 == 0 or i % 5 == 0:
        continue
    else:
        result += i
print(result)
n=int(input())
ans=0
for i in (1,n+1):
  if i%3!=0 and i%5!=0:
    ans+=i
print(ans)
import sys
input = sys.stdin.readline
N = int(input())
total = 0
for i in range(1, N):
    if i % 3 and i % 5:
        total += i
print(total)
n=int(input())
s=0
for i in range(1,n+1):
    if i%3!=0 or i%3!=5:
        s+=i
print(s)
N = int (input())
sum = 0
for i in range (1, N):
    if i % 3 == 0 and i % 5 == 0: continue
    elif i % 3 == 0: continue
    elif i % 5 == 0: continue
    else: sum += i 
print (sum)
N = int(input())
s = 0
for i in range(1,N+1):
    if i%3 != 0 and i%5 != 0:
        s += i
    print(s)
def main():
    import math
    import sys

    input = sys.stdin.readline

    n = int(input())
    c = 0
    for i in range(n):
        if i % 3 == 0:
            continue
        elif i % 5 ==0:
            continue
        else:
            c += i
    print(c)


if __name__ == '__main__':
    main()
c = 0
for i in range(int(input())):
  if (i%3!=0)&(i%5!=0):
    c += i
print(c)
n=int(input())
ret = n*(n+1)//2
ret -= 3*(1+n//3)//2
ret -= 5*(1+n//5)//2
ret += 15*(1+n//15)//2
print(ret)
list = []
for i in range(1,1000010):
  if(i%3==0 or i%5==0):
    list.append(0)
  else:
    list.append(i)
n = int(input())
print(list[:n-1])
num = int(input())
sum_num = 0
for i in range(0,num):
  if (i % 5 != 0) and (i % 3 != 0):
    sum_num += i
print(sum_num)
N = int(input())

total = 0
for i in range(N):
  if i % 3 != 0 and i % 5 != 0:
    total += i + 1
print(total)
a = int(input())
sums = 0
for i in range(a):
  if i%3!=0 and i%5!=0:
    sums+=i
print(sums)
n = int(input())
ans = 0
for i in range(n):
  if i%3==0 and i%5==0:
    ans = ans
  elif i%3==0:
    ans = ans
  elif i%5==0:
    ans = ans
  else:
    ans =ans+i

print(ans)