peterverebics/CodeNet_Python_118 huggingface dataset:
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())
list = []
for i in range(N+1):
    if i % 3 == 0 and i % 5 == 0:
        list.append(i)
        continue
    elif i % 3 == 0:
        list.append(i)
        continue
    elif i % 5 == 0:
        list.append(i)
        continue
print(sum(list))
from sys import stdin

# 1行だけ読むやつ

N = int(stdin.readline().rstrip().split()[0])
Sum = 0

for i in range(1, N+1):
    if i % 3 == 0 or i % 5 == 0 or i % 15 == 0:
        continue
    else:
        Sum += i
        print(i)

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

print(c)
import math
#数値ひとつ
I = int(input())
#数値欲しいとき
#H, W = map(int, input().split())
#文字欲しいとき
#N = input()
#それをListにしたいとき
#listA = list(N)
a = 0
for num in range(I):
    if num%3 == 0 and num%5 == 0:
        print('FizzBuzz')
    elif num%3 == 0:
        print('Fizz')
    elif num%5 == 0:
        print('Buzz')
    else:
        a = a + num

print(a)
n=int(input())
count=0
for i in range(n):
    if i%3!=0 and i%5!=0:
        count+=i
print(count)
N=int(input())
P=0
for i in range(N):
    if i%3==0 or i%5==0:
        P+=1
print(P)
import queue
import math
import copy
"""
N = int(input())
#S = input()
# (N,M) = (int(i) for i in input().split(" "))
# A = [int(i) for i in input().split()]
A = []
for i in range(N):
	A.append(int(input()))

print(A)

"""

a = int(input())
Ans = 0
for i in range(1,a):
	if i%3 != 0 and i%5 != 0:
		Ans += i
print(Ans)
N = int(input())
ans = 0
for i in range(1, N+1):
  if not (i%3==0 or i%5==0 or i%15==0):
    ans += i
print(i)
N = int(input())
print(["FizzBuzz" if n % 15 == 0 else "Fizz" if n % 3 == 0 else "Buzz" if n % 5 == 0 else n for n in range(1,N)])
n = int(input())
sum = 0 
i = 0
while i <= n:
    sum = sum + i
    i += 1
print(int(sum/2))
import numpy as np
def main():
    n = int(input())
    arr = np.arange(n + 1)
    arr[3::3] = 0
    arr[5::5] = 0
    print(arr)
    print(arr.sum())
if __name__ =='__main__':
    main()
n = int(input())
ans = 0
for i in range(1, n):
    if i % 3 == 0 or i % 5 == 0:
        continue
    ans += i
print(ans)
input_line = int(input())

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

print(allsum)
# 1 <= N <= 1000000
for i in range(1, 10000):
    if i % 3 and i % 5 == 0:
        print("FizzBuzz")
    elif i % 3 == 0:
        print("Fizz")
    elif i % 5 == 0:
        print("Buzz")
    else:
        print(i)

# 和を求める
n = int(input())

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

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

for i in range(n):
    if i % 3 == 0 and i % 5 == 0:
        # print("FizzBuzz")
        sum += 0
    elif i % 3 == 0:
        # print("Fizz")
        sum += 0
    elif i % 5 == 0:
        # print("Buzz")
        sum += 0
    else:
        sum += i

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

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

print(sum)
N = int(input())
sum = 0
for i in range(N):
	if (i+1) % 5 != 0 and (i+1) % 3 != 0:
		sum += i
print(sum)
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 or i%15==0:
        continue
    sum += i
print(sum)
import sys
import math
readline = sys.stdin.readline


def main():
    n = int(readline().rstrip())
    allSum = n * (n + 1) // 2
    threeNum = math.floor(n / 3)
    threeSum = 3 * threeNum * (threeNum + 1) // 2
    fiveNum = math.floor(n / 5)
    fiveSum = 5 * fiveNum * (fiveNum + 1) // 2
    bothNum = math.floor(n / 15)
    bothSum = 15 * bothNum * (bothNum + 1) // 2
    print(allSum, bothSum, threeSum, fiveSum)
    print(allSum + bothSum - threeSum - fiveSum)


if __name__ == '__main__':
    main()
x = int(input())
count = 0
for i in range(x):
  if i % 3 == 0:
    pass
  elif i % 5 == 0:
    pass
  else:
    count += i

print(count)
N = int(input())
B = 0

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

print(B)
n = int(input())
#n = 1000000
#a = []
sum = 0

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

print(sum)
N = int(input())
if 1 <= N <= 10**6:
    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
        Sum = Sum + i
    print(Sum)
else:
    pass
n = int(input())

FB_list = []
FB_all = 0
FB_non = 0
for i in range(1,n+1):
    FB_all += i
    if (i % 3 == 0 and i % 5 == 0) or (i % 3 != 0 and i % 5 == 0) or (i % 3 == 0 and i % 5 != 0):
        FB_list.append(0)
    else:
        FB_list.append(i)
FB_non = sum(FB_list)
print((FB_all) - (FB_non))
N = int(input())
sum = 0
for i in range(N):
	if i % 3 != 0 and i % 5 != 0:
		sum = sum + i
print(sum)
n = int(input())
s = []
for i in range(n):
  if not i%3==0:
    if not i%5==0:
      s.append(i)
print(sum(s))
N=int(input())
c=0
for i in range(1,N):
    if i%3!=0 and i%5!=0:
        c=c+i
print(c)
n=int(input())
U=(1/2)*n*(n+1)
U3=(3/2)*(n//3)*(n//3+1)
U5=(5/2)*(n//5)*(n//5+1)
U15=(15/2)*(n//15)*(n//15+1)
ans=U-U3-U5+U15
print(ans)
import math
#数値ひとつ
I = int(input())
#数値欲しいとき
#H, W = map(int, input().split())
#文字欲しいとき
#N = input()
#それをListにしたいとき
#listA = list(N)

a = 0
for num in range(I):
    print(num)
    if num%3 == 0 and num%5 == 0:
        print('FizzBuzz')
    elif num%3 == 0:
        print('Fizz')
    elif num%5 == 0:
        print('Buzz')
    else:
        a = a + num

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

for i in range(int(N)+1):
    if i % 15 == 0:
        print('FizzBuzz')
    elif i % 5 ==0:
        print('Buzz')
    elif i % 3 ==0:
        print('Fizz')
    else:
        print(i)
n = int(input())

ans = 0
for i in range(n):
    if i % 3 != 0 and i % 3 != 5:
        ans += i
print(ans)
x=int(input())
t=[]
for i in range(x):
  if i%3!=0 and i%5!=0:
    t.append(i)
print(sum(t))
n = int(input())
ans = []
for i in range(n):
    if i%3 != 0 and i %5 != 0:
        ans.append(i)
print(sum(ans))
n = int(input())
result = 0;
for i in range(n):
    if i % 3 != 0 and i % 5 != 0:
        result += i
print(result)
s = int (input())
sum = 0
for x in range(s):
  if ((x+1)%3)or((x+1)%5) == 0 :
    sum = sum + x
print (sum)
N = int(input())
total = 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:
        total += i
    

print(total)
def is_fb(i):
    if i % 3 == 0:
        return True
    if i % 5 == 0:
        return True
    return False

N = int(input())

print(sum([a for a in range(1, N) if not is_fb(a)]))
a=0

for i in range(int(input())):
	if i%15==0:
		continue
	elif i%3==0:
		continue
	elif i%5==0:
		continue
	else:
		a+=i
print(a)
n = int(input())
count = 0
for i in range(1,n):
  if i%3!=0 and i%5!=0:
    count+=i
print(count)
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n = int(input())

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

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

list = [i for i in range(1, N+1) if not (i % 3 == 0 or i % 5 ==0)]
print(list)
print(sum(list))
n=int(input())

res=0

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

for i in range(1, n + 1):
  if not i % 3 == 0 and i % 5 == 0:
    result += i
    
print(result)
n = int(input())
s=0
for i in range(1,n+1):
  if i%3!=0 or i%5!=0 or i%15!=0:
    s+=i
print(s)
import numpy as np
N = int(input())
if N >= 2 :
    An = np.empty(N+2)
    #An = [[] for _ in range(1,N+2)]
    #print(An)
    for s in range(1,N+1) :
        #print(s)
        if s%3 != 0 and s%5 != 0 :
            An[s] = int(s) 
            #print(s)
            print(An[s])
    ans = np.sum(An)
else:
    ans = int(1)

print (int(ans))
n = int(input())
if n / 15 == 0:
    n = 8
elif n / 3 == 0:
    n = 4
elif n / 5 == 0:
    n = 4
    total = 0
    for i in range(1, n +1):
        total += i
        print(total)
n = int(input())
ans = 0
for i in range(n):
    if i%3 != 0 or i%5 != 0:
        ans += i
print(ans)
n = int(input())
fibz = []
for i in range (n):
  if i%3 >0 and i%5 >0:
    fibz.append(int(i))
print(sum(fibz))
def solve():
    N = int(input())
    suma = 0
    for i in range(N):
        if i % 3 != 0 and i % 5 != 0:
            suma += i
    print(suma)

if __name__ == '__main__':
    solve()
i = int(input())

total = 0

for j in range(i):
  if not(j % 3 ==0 or j % 5 == 0):
    total += j
    
print(total)
N = int(input())

fizzbuzz = []

for i in range(1, N):
    if i % 15 == 0:
        fizzbuzz.append('0')
    elif i % 3 == 0:
        fizzbuzz.append('0')
    elif i % 5 == 0:
        fizzbuzz.append('0')
    else:
        fizzbuzz.append(str(i))

num = [int(s) for s in fizzbuzz]
print(sum(num))
n=int(input())
o=list(i for i in range(1,n+1))
sum=0
l=[]
for j in o:
    if j % 5 == 0 or j % 3 == 0:
        o.remove(j)
for k in o:
    sum+=k
print(sum)
n = int(input())
sum = n*(n-1)/2
for i in range(n):
    if i%3 == 0 or i%5 == 0:
        sum-=i
print(int(sum))
n = int(input())
ans = 0
for i in range(1, n):
    if 0 != i%3 and 0 != i%5:
        ans += i
print(ans)
N = int(input())
ans = sum([n for n in range(1, N) if (n%3!=0) and (n%5!=0)])
print(ans)
n = int(input())
sum = 0
for i in range(1, n):
    if (i%3!=0):
        if i%5!=0:
            sum = sum+i
print(sum)
n = int(input())
ans = 0
for i in range(n):
    if i % 3 != 0:
        if i % 5 != 0:
            ans += i

print(ans)
N = int(input())
A=N//3
B=N//5
AanB=N//15
Ssum=(1+N)*N*(1/2)
Asum=(1+A)*A*(1/2)*3
Bsum=(1+B)*B*(1/2)*5
AanBsum=(1+AanB)*AanB*(1/2)*15
print(Ssum-Asum-Bsum-AanBsum)
m = int(input())
 
def fizz_buzz(i):
  fizz = i % 3
  buzz = i % 5
  
  return (fizz > 0) & (buzz > 1)
 
res = 0
 
for i in range(m):
  use_i = i+1
  if fizz_buzz(use_i):
    res += use_i
n = int(input())
a = 0
for i in range(1, n + 1):
    if (i % 3 != 0) and (i % 5 != 0):
        a = a + 1
    print(a)
n=int(input())
sum=0

for i in range(n):
  if i%3==0 or i%5==0:
    break
  else:
    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())
count =0
for i in range(1,n):
    if (i %3) !=0:
        if (i %5) !=0:
            count +=i
print(count)
import numpy as np
result = 0
n = int(input()) 
a = np.arange(1,(n+1)) 
for i in a:
    if i % 3 == 0 or i % 5 == 0:
      result += i
print(result)
n = int(input())
n3 = n // 3
n5 = n // 5
n15 = n // 15

print(n*(n+1)/2 - 3*n3*(n3+1)/2 - 5*n5*(n5+1)/2 + 15*n15*(n15+1)/2)
N = int(input())

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

print(sum)
N = int(input())
sum = 0
for i in range(N):
	if i % 5 != 0 and i % 3 != 0:
		sum += i
print(sum)
N = int(input())
answer = 0
for i in range(N):
    if i % 3 != 0 and i % 5 != 0 and i % 15 != 0:
        answer += i
print(answer)
n = input()
a = 0
for i in range(int(n)):
    if i%3 != 0:
        if i%5 !=0:
            a = a+i
print(a)
def could_divide(num):
  return (num%3==0 or num%5==0)
n=int(input())
answer=0
for i in range(1,n+1):
  if(could_divide(i)):
    answer+=i
print(answer)
N=1000000
sum=0
for i in range(1,N+1):
    if i % 3 != 0 and i % 5 != 0:
        #print(i)
        sum += i
print(sum)
import numpy as np
result = 0
a = np.arange(1,(int(input()))+1) 
for i in a:
    if i % 3 == 0 or i % 5 == 0:
      result += i
print(result)
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())
l = []
a = 0
for i in range(n):
    if i%3 == 0 or i%5 == 0 or i%15 == 0:
        a+=1
    else:
        l.append(i)
print(sum(l))
q = int(input())

sum = 0
for num in range(1, q):
    # say=""
    if num % 3 == 0:
        continue
        # say = "Fizz"
    elif num % 5 == 0:
        continue
        # say = say+"Buzz"
    else:
        sum += num

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

print(p)
def main():
    n = int(input())
    a, b = n // 15, n % 15

    fbeg = [i for i in range(1, 16) if i % 3 != 0 and i % 5 != 0]
    fend = [i for i in range(a * 15, n + 1) if i % 3 != 0 and i % 5 != 0]

    ne = len(fbeg)
    fbs = sum(fbeg) # sum of first terms in [1, 15]
    fes = sum(fend)
    step = 15 * ne
    first = fbs
    last = fbs + (a-1) * step

    tot = (first + last) * (last - first + step) // step // 2 + sum(fend)

    print(tot)
FizzBizz = int(input())

Sum = []
for i in range(FizzBizz):
    if i % 3 != 0 and i % 5 != 0:
        Sum.append(i)
    else:
        Sum.append(0)
print(sum(Sum))
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)
num = int(input())
fizz_buzz_sum = 0
for i in range(1, num + 1):
  if i % 3 != 0 or i % 5 != 0:
    fizz_buzz_sum += i

print(fizz_buzz_sum)
n = int(input())

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

print(sum)
a = int(input())
b = 0
for i in range(a):
  if i %3 ==0 or i %5 ==0:
    continue
  else:
    b += i
print(b)
n = int(input())
sum = n*(n-1)/2
for i in range(1,n):
    if i%3 == 0 or i%5 == 0:
        sum-=i
print(int(sum))
N = int(input())
 
cnt = 0
for i in range(1, N+1):
  if i%3!=0 and i%5!=0:
    cnt += i
print(i)
N = int(input())

ans = 0

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

count = 0

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

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

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

print(n)
N = 1000000#int(input())
a = list(range(1,N+1))
N_3 = N//3
N_5 = N//5
for i in range(1,N_3+1):
    a[3*i-1] = 0
for i in range(1,N_5+1):
    a[5*i-1] = 0
print(sum(a))
N = int(input())
count_list = []
for i in range(N * 15 + 1):
    if i % 15 == 0:
        count_list.append('FizzBuzz')
    elif i % 3 == 0:
        count_list.append('Fizz')
    elif i % 5 == 0:
        count_list.append('Buzz')
    else:
        count_list.append(i)
int_list = []
for i in count_list:
    try:
        int_list.append(int(i))
    except:
        pass
print(sum(int_list))
N = int(input())

fizzbuzz = []

for i in range(1, N):
    if i % 3 == 0 or i % 5 == 0:
        fizzbuzz.append('0')
    else:
        fizzbuzz.append(str(i))

num = [int(s) for s in fizzbuzz]
print(sum(num))
s=int(input())
sum=0
for i in range(1, s):
    if i % 5 == 0:
        pass
    elif i % 3 == 0:
        pass
    elif i % 5 == 0:
        pass
    else:
        sum+=i
print(sum)
N = int(input())
answer = 0
for i in range(1,N):
    if i % 3 != 0:
        if i % 5 != 0:
            answer += i
            continue
    if i % 5 != 0:
        if i % 3 != 0:
            answer += i
            continue
print(answer)
N = int(input())

ans = 0
for n in range(1,N+1):
  if n%3==0 and n%5==0:
    pass
  else:
    ans += n
print(ans)
#!/usr/bin/python3
N = int(input())
wa = 0
for i in range(N):
    if i % 3 != 0 and i % 5 != 0:
        wa += i
print(wa)
n = int(input())
l = list(range(1,n))
l_ans = [n for n  in l if (n % 5 != 0) and (n % 3 != 0)]
print(sum(l_ans))
Y =  int(input())
sum = 0
for i in range(1, Y):
    if i % 3 != 0 and i % 5 != 0:
        sum += i
print(sum)
n = int(input())
add = 0
for i in range(n):
  if i%3!=0:
    if i%5!=0:
      add += i
print(add)
n = int(input())
suma = 0
for i in range(n):
    if not (i % 3 == 0 and i % 5 == 0 or i % 3 == 0 or i % 5 == 0):
        suma = i + suma
print(suma)
N = int(input())  
a =[]
for i in range(N):
    if i% 3 !=0 and i% 5 !=0:
        a.append(i)
print(sum(a))
import sys
sys.setrecursionlimit(10**6)
N=int(input())
n=list()
m=list()
for i in range(N):
    if(i%3==0 or i%5==0):
        n.append(i)
    else:
        m.append(i)
print(sum(m))
N = int(input())

SUM = N*(N+1)/2

Fizz_count = N//3
Buzz_count = N//5
FizzBuzz_count = N//15
## r>1
def GeometricProgression(a_1,r,n):
    return int(a_1*(r^n -1)/r-1)

SUM_Fizz = GeometricProgression(3,3,Fizz_count)
SUM_Buzz = GeometricProgression(5,5,Buzz_count)
SUM_FizzBuzz = GeometricProgression(15,15,FizzBuzz_count)

result = int(SUM - SUM_Fizz - SUM_Buzz + SUM_FizzBuzz)
print(result)
n=int(input())
add=0
for i in range(1,n):
    if i%3!=0 and i%5!=0:
        add+=i
print(add)
n =int(input())
ans = 1

for i in range(2,n):
    if i%3>0 and i%5>0:
        ans += i

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


print(K)
#162B
#FizzBuzz Sum

n=int(input())

print(sum(x for x in range(1,n) if x%3!=0 and x%5!=0))
def resolve():
    n = int(input())
    ans = 0
    for i in range(n):
        if i%3!=0 and i%5!=0:
            ans += i
    print(ans)
resolve()
N = int(input())
l = []
for i in range(N+1):
    if i % 3 == 0 or i % 5 == 0:
        l.append(i)
print(sum(l))
a = int(input())
b = []

for i in range(1, a):
    if i % 3 == 0 and i % 5 == 0:
        pass
    elif i % 3 == 0:
        pass
    elif i % 5 == 0:
        pass
    else:
      b.append(i)
print(sum(b))
N=int(input())
num_list=[]
for i in range(N+1):
  if i%3!=0 or i%5!=0:
    num_list.append(i)
print(sum(num_list))
N=int(input())
S=0
for i in range(N):
    if (i%3==0)or(i%5==0):
      continue
    elif(i%3==0)and(i%5==0):
      continue
    else:
      S+=i
print(S)
number=int(input())
count=0
for i in range(number):
    if (i%3!=0 and i%5!=0):
        count+=i
print(count)
N= int(input())
if (N < 1 or N > 1000000):
    print('error')
sum = 0
for i in range(1, N):
    if (i % 3 != 0 and i % 5 != 0 ):
        sum = sum + i
print(sum)
#B
n = int(input())
ans=0
for i in range(1, n + 1):
    if i % 3 == 0 or i % 5 == 0:
        ans += i
        print(i)
print(ans)
N = int(input())
ans = 0
for i in range(0,N+1):
    if i%3!=0 and i%5!=0 :
        ans += 1
print(ans)
# 入力をint型にする
N = int(input())

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

# Pythonの全て
# https://qiita.com/KoyanagiHitoshi/items/3286fbc65d56dd67737c#56-%E7%B5%B6%E5%AF%BE%E5%80%A4abs
N = int(input())
total = 0
for i in range(1, N+1):
  if i%3 and i%5:
    continue
  elif i%3:
    continue
  elif i%5:
    continue
  else:
    total += i
print(total)
n = int(input())
s = []
for i in range(n):
  if i%3!=0 and i%5!=0:
       s.append(i)
print(sum(s))
n = int(input())

ans = 0

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

print(ans)
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]

N = getInput()[0]
sums = 0
for i in range(1, N+1):
    if i%3 == 0 or i%5 == 0:
        continue
    else:
        sums += i
N = int(input())

n_list = []
for n in range(N):
    if n % 15 == 0:
        n_list.append(0)
    elif n % 3 == 0:
        n_list.append(0)
    elif n % 5 == 0:
        n_list.append(0)
    else:
        n_list.append(n)
num = n_list[:N]
print(sum(num))
N = int(input())
total = 0
for i in range(1,N):
	if i % 3 != 0 and i % 5 != 0:
		total += i
 
print(total)
n=int(input())
a=n//3
ans=(a+1)*a//2*3
b=n//5
ans+=(b+1)*b//2*5
c=n//15
ans-=(c+1)*c//2*15
print(ans)
N=int(input())
i=int (0)
S=[]
for i in range(N):
    if i%15!=0 and i%3!=0 and i%5!=0:
        S.append(i)
print(sum(S))
N = int(input())
i = 0
result = 0
while i < N:
    if i % 3 != 0 and i % 5 != 0:
        result += i
    i += 1
print(result)
import numpy as np

n = input()
N = int(n)

s = np.sum([i for i in range(N+1) if (i%3==0)and(i%5==0)])
print(s)
n = int(input())
total = 0
for i in range(n):
    if ((i%5!=0) and (i%3!=0)):
        total += i
print(total)
i = int(input())
t1=0.5*i*(i+1)

i3=int(i/3)
t3=0.5*i3*(i3+1)*3

i5=int(i/5)
t5=0.5*i5*(i5+1)*5

i15=int(i/15)
t15=0.5*i15*(i15+1)*15

ans=int(t1-t3-t5+15)
print(ans)
n = int(input())
add = 0
for i in range(n):
  if i%3!=0 and i%5!=0:
      add += i
print(add)
N = int(input())
count = 0
for x in range(0, N):
    if x%3!=0 and x%5!=0:
       count=count+x
print(count)
n = int(input())
ans = 0
for i in range(1, n):
    if 0 != i%3 or 0 != i%5:
        ans += i
print(ans)
n = int(input())

total = 0

for i in range(1, n):
    if not (i % 3 == 0 or i % 5 == 0):
        total += i

print(total)
n = int(input())

totalsum = []

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

print(sum(totalsum))
n = int(input())
ans = n*(n+1)//2
d = n%3
ans -= 3*(d+1)*d//2
e = n%5
ans -= 5*(e+1)*e//2
f = n%15
ans -= 15*(f+1)*f//2
print(ans)
N = int(input())
def fbn(n):
    return (x for x in range(n) if x % 3 and x % 5 and x % 15)
print(sum(fbn(N)))
N = int(input())
n_list = [0 if (n % 15 == 0 or n % 3 == 0 or n % 5 == 0) else n for n in range(N)]
print(sum(n_list))
a = int(input())
b = []

for i in range(1, a):
    if i % 15 == 0:
      pass
    elif i % 3 == 0:
      pass
    elif i % 5 == 0:
      pass
    else:
      b.append(i)
print(sum(b))
N = int(input())
a_i = 0
for i in range(1, 15):
    if i % 3 != 0:
        if i % 5 != 0:
            a_i += i
print(a_i)
# N:標準入力
N = int(input())

# 結果の出力のための変数定義
result = 0

# Nまでの条件以外の繰り返しの合計
for i in range(1, N + 1):
    if (i % 15 == 0 or i % 3 == 0 or i % 5 == 0):
        result += 0
    else:
        result += i
    print(result)
N = int(input())
j = 0
for i  in range(0,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)
n = int(input())

samu = 0

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

print(str(int(samu)))
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())
cnt=0
for i in range(n):
  if i%3!=0 and i%5!=0:
    cnt+=i
    
print(cnt)
n = int(input())
for i in range(1, n + 1):
    if i % 3 == 0 and i % 5 == 0:
        print('FizzzBuzz')
    elif i % 3 == 0:
        print('Fizz')
    elif i % 5 == 0:
        print('Buzz')
    else:
        print(str(i))
n = int(input())
answer = 0
for i in range(n):
    if not(i % 3 == 0 or i % 5 == 0):
        answer += i
print(answer)
a = int(input())
j = 0
for i in range(1, a + 1):
    if i%3!=0 and i%5!=0:
        print(i)
        j+=i
print(j)
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())
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 or i % 5 == 0:
        continue
    ans += i

print(ans)
a = int(input())
sum = 0
list_number = []
for i in range(a):
    list_number.append(i)
for i in list_number:
    if i % 3 == 0 and i % 5 == 0:
        list_number.remove(i)
for i in list_number:
    if i % 3 == 0:
        list_number.remove(i)
for i in list_number:
    if i % 5 == 0:
        list_number.remove(i)
for i in list_number:
    sum = sum + i
print(list_number)
print(sum)
n = int(input())
k = n//3
l = n//5
m = n//15
print(n*(n+1)/2-5*l*(l+1)/2-3*k*(k+1)/2+15*m*(m+1)/2)
N = int(input())

def check(N):
    if N%3==0:
        return False
    if N%5==0:
        return False
    return True

ans = 0
for i in range(N):
    if check(i):
        ans += i
        
print(ans)
N=int(input())
R=0

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

print(R)
N = int(input())
 
L = []
for i in range(1, N+1):
    if i % 15==0:
        L.append(i)
    if i%3==0:
        L.append(i)
    elif i%5==0:
        L.append(i)
 
print(sum(L))
n = int(input())
x = 0
li = list(range(1,n))
for i in range(n - 1) :
    if li[i] % 3 == 0 or li[i] % 5 == 0:
        pass
    
    else:
        x += li[i]
print(x)