Problem:
 Score : 200 points    Problem Statement Let us define the FizzBuzz sequence  a_1,a_2,... as follows:   If both 3 and 5 divides i , a_i=\mbox{FizzBuzz} .  If the above does not hold but 3 divides i , a_i=\mbox{Fizz} .  If none of the above holds but 5 divides i , a_i=\mbox{Buzz} .  If none of the above holds, a_i=i .   Find the sum of all numbers among the first N terms of the FizzBuzz sequence.      Constraints  1 \leq N \leq 10^6         Input Input is given from Standard Input in the following format:  N       Output Print the sum of all numbers among the first N terms of the FizzBuzz sequence.        Sample Input 1 15      Sample Output 1 60  The first 15 terms of the FizzBuzz sequence are:  1,2,\mbox{Fizz},4,\mbox{Buzz},\mbox{Fizz},7,8,\mbox{Fizz},\mbox{Buzz},11,\mbox{Fizz},13,14,\mbox{FizzBuzz}  Among them, numbers are 1,2,4,7,8,11,13,14 , and the sum of them is 60 .       Sample Input 2 1000000      Sample Output 2 266666333332  Watch out for overflow.

Solution (Python):

from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)

def main():
    N = I()

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

Solution (Python):
N = int(input())

max = 10**6

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

print(sum)

Solution (Python):
n = int(input())
print(sum([i for i in range(1, n + 1) if i % 3 and i % 5]))

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

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

Solution (Python):
N = int(input())
ans = 0

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

Solution (Python):
import math
N = int(input())
total = N/2*(N+1)

f = math.floor(N/3)
f = (3*f+3)*f/2
b = math.floor(N/5)
b = (5*b+5)*b/2
fb = math.floor(N/15)
fb = (15*fb+15)*fb/2

print(int(total-f-b+fb))

Solution (Python):
N = int(input())
l = []
n = 0
for i in range(1,N+1):
    if i%3==0 and i%5==0:
        l.append('FizzBuzz')
    else:
        if i%3==0:
            l.append('Fizz')
        elif i%5==0:
            l.append('Buzz')
        else:
            l.append(i)
            n += i
print(n)

Solution (Python):
n = int(input())
num = [int(x) for x in range(1,n+1)]

for i in num:
  if (i%3 == 0) or (i%5 == 0):
    num[i-1] = 0
    
print(sum(num))

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

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

Solution (Python):
n = int(input())
l=[]
for i in range(n+1):
    if ((i%3)!=0)  and ((i%5)!=0):
        l.append(i)
print(sum(l))

Solution (Python):
n = int(input())
ans = 0

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

print(ans)

Solution (Python):
N = int(input())

print(((N*(N+1)) - ((3+N-(N%3))*(N//3)) - ((5+N-(N%5))*(N//5)) +  ((15+N-(N%15))*(N//15)))//2)

Solution (Python):
a = int(input())
s = 0
b = 1
while 15*b <= a:
  s += 8*b
  b += 1
while 5*b <= a:
  s -= 7*b
  b += 1
while 3*b <= a:
  s -= 2*b
  b += 1
while b <= a:
  s += b
  b += 1
print(s)

Solution (Python):
N = int(input())
 
ans = 0
for i in range(1, N+1):
  if i%3 == 0 or i%5 == 0:
    continue
  else:
    ans += i

print(ans)

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

print(sum)

Solution (Python):
n=int(input())

ans=0

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

print(ans)

Solution (Python):
n = int(input())

count = 0

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

print(count)

Solution (Python):
n = int(input())

a = [0 for i in range(n)]

count = 0

for i in range(n):
  if (i+1)%3 == 0 or (i+1)%5 == 0:
    continue
  else:
    a[i] = (i+1)
    count += (i+1)

print(count)

Solution (Python):
N=int(input())
a=[]
for i in range(1,N+1):
    if i%3!=0 and i%5!=0:
        a.append(i)
print(sum(a))

Solution (Python):
n = int(input())

a = n // 15
c = a*(a-1)//2
b = n % 15

l = [1, 2, 0, 4, 0, 0, 7, 8, 0, 0, 11, 0, 13, 14]
for i in range(len(l)):
    if l[i] != 0:
        l[i] += 15*a

print(60*a + 120*c + sum(l[:b]) )

Solution (Python):
n = int(input())
s1 = int(n * (n+1)/2)
s2 = int(n//3 * (n//3 + 1) * 3/2)
s3 = int(n//5 * (n//5 + 1) * 5/2)
s4 = int(n//15 * (n//15 + 1) * 15/2)
 
print(s1 - s2 - s3 + s4)

Solution (Python):
n = int(input())

sumall = int(n * (n+1)/2)
sum3 = int(n//3 * (n//3 + 1) * 3/2)
sum5 = int(n//5 * (n//5 + 1) * 5/2)
sum15 = int(n//15 * (n//15 + 1) * 15/2)

print(sumall - sum3 - sum5 + sum15)

Solution (Python):
n = int(input())

sumall = int(n * (n+1)/2)
sum3 = int(n//3 * (n//3 + 1) * 3/2)
sum5 = int(n//5 * (n//5 + 1) * 5/2)
sum15 = int(n//15 * (n//15 + 1) * 15/2)

print(sumall - sum3 - sum5 + sum15)

Solution (Python):
N = int(input())
total = 0
for i in range(1, N+1):
    if (i % 3) != 0 and (i % 5) != 0:
        total = total+i
print(total)

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

Solution (Python):
N = int(input())
S = 0
 
for i in range(1, N+1):
    if i % 3 == 0 and i % 5 == 0:
        i = "FizzBuzz"
    elif i % 3 == 0:
        i = "Fizz"
    elif i % 5 == 0:
        i = "Buzz"
    else:
        S += i
 
print(S)

Solution (Python):
N = int(input())
S = 0
 
for i in range(1, N+1):
    if i % 3 == 0 and i % 5 == 0:
        i = "FizzBuzz"
    elif i % 3 == 0:
        i = "Fizz"
    elif i % 5 == 0:
        i = "Buzz"
    else:
        S += i
 
print(S)

Solution (Python):
n = int(input())
s = 0

for i in range(1, n+1):
    if i % 3 == 0 and i % 5 == 0:
        i = "FizzBuzz"
    elif i % 3 == 0:
        i = "Fizz"
    elif i % 5 == 0:
        i = "Buzz"
    else:
        s += i
    

print(s)

Solution (Python):
def main():
  n =int(input())
  li = [0] * n
  
  for i in range(1, n+1):
    li[i-1] += i
  
  length = len(li)
  total = 0
  
  for k in range(0, length):
    if li[k] % 3 != 0 and li[k] % 5 != 0:
      total += li[k]
      
  print(total)
      
  
main()

Solution (Python):
N = int(input())
ans = 0

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

Solution (Python):
n = int(input())
sum = 0
for i in range (n+1):
    if i%3==0 and i%5==0:
        continue
    elif i%3==0:
        continue
    elif i%5==0:
        continue
    else:
        sum += i
print(sum)

Solution (Python):
import sys
import itertools

import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(input())

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

Solution (Python):
N=int(input())
sum=0

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

print(sum)

Solution (Python):
N = int(input())
sum = 0
for i in range(1,N+1):
    if i % 3 == 0 or i % 5 == 0:
        continue
    sum += i
print(sum)

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

Solution (Python):
n = int(input())
res = 0
for i in range(1,n+1):
    if i % 15 != 0 and i % 3 != 0 and i % 5 !=0:
        res += i
print(res)

Solution (Python):
N = int(input())
result = 0
for i in range(1, N+1):
    if i%3 != 0 and i%5 != 0:
        result += i
print(result)

Solution (Python):
import sys
read = sys.stdin.buffer.read






def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))



def main():
	n=II()
	
	ans=0
	for i in range(1,n+1):
		if i%3!=0 and i%5!=0:
			ans+=i
	
	print(ans)
	
if __name__ == "__main__":
	main()

Solution (Python):
N = int(input())


def sum(n):
    return n*(n+1)//2





ans = sum(N)-sum(N//3)*3-sum(N//5)*5+sum(N//15)*15
print(ans)

Solution (Python):
n=int(input())
a=[]
for i in range(1,n+1):
    if not(i%3==0 or i%5==0):
        a.append(i)
print(sum(a))

Solution (Python):
import numpy as np
def cumsum(x):
    return list(np.cumsum(x))

def cumsum_number(N,K,x):
    ans=[0]*(N-K+1)
    number_cumsum = cumsum(x)
    number_cumsum.insert(0,0)
    for i in range(N-K+1):
        ans[i]=number_cumsum[i+K]-number_cumsum[i]
    return ans
"""
int 
float 


for name in fruits: 
    print(name)


list0 = [] 
list0 = [1,2,3,4] 
list0 = [0]*10 
list1= [i for i in range(10)] 
list1 = list(map(int, input().split()))　
number=[int(input()) for i in range(int(input()))] 
list1 = list1 + [6, 7, 8] 
list2.append(34) 
list.insert(3,10) 
len(list4) 
max(sa) 
list5.count(2) 
list1.sort() 
list1.sort(reverse=True)  
set(list1) 
sum([2,3,   ,3]) 

abs(a) 
max(a,b) min(a,b) 
text1 = text1.replace("34","test") 

exit(0) 

cumsum(リスト) 
cumsum_number(N,K,x) 
"""
N=int(input())
ans=0
for j in range(N):
    if (j+1)%3!=0 and (j+1)%5!=0:
        ans += j+1
print(ans)

Solution (Python):
N = int(input())
A = 0
for i in range(1, N+1):
  if i%3 > 0 and i%5 > 0:
    A += i
print(A)

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

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

print(ans)

Solution (Python):
n = int(input())
s = []
for i in range(1, n+1):
    if i % 3 == 0:
        continue
    elif i % 5 == 0:
        continue
    else:
        s.append(i)
print(sum(s))

Solution (Python):
N = int(input())

a = [i for i in range(1,N + 1)]

ans = 0

for i in range(N):
  if a[i]%15 == 0:
    a[i] = "FizzBuzz"
  elif a[i]%3 == 0:
    a[i] = "Fizz"
  elif a[i]%5 == 0:
    a[i] = "Buzz"
    
for i in a:
  if type(i) == int:
    ans += i
    
print(ans)

Solution (Python):
n = int(input())
l = list(range(1, n+1))
for i in range(len(l)):
    if l[i] % 3 == 0 or l[i] % 5 == 0:
        l[i] = 0

print(sum(l))

Solution (Python):
N = int(input())
num = list(range(N+1))
for i in range(3, N+1, 3):
    num[i] = 0
for i in range(5, N+1, 5):
    num[i] = 0
print(sum(num))

Solution (Python):
n = int(input())

result = []
for i in range(n):
    a = i + 1
    if a % 3 != 0 and a % 5 != 0:
        result.append(a)
print(sum(result))

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

Solution (Python):
n = input()

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

print(sum)

Solution (Python):
num = int(input())
ans = 0
for i in range(num):
  i = i + 1
  if(i%3!=0 and i%5!=0):
    ans += i 
print(ans)

Solution (Python):
n=int(input())
a=[0,1,2,0,4,0,0,7,8,0,0,11,0,13,14]
s=0
for i in range(n+1):
  if a[i%15]!=0:
    s+=a[i%15]+i//15*15
print(s)

Solution (Python):
a=int(input())
b=a//3
c=a//5
d=a//15

z=0
y=0
w=0
v=0

for x in range(a+1):
  z=z+x

for x in range(b+1):
  y=y+x*3

for x in range(c+1):
  w=w+x*5

for x in range(d+1):
  v=v+x*15

print(z-y-w+v)

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

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

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

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

Solution (Python):
n = int(input())
rslt = 0

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

print(rslt)

Solution (Python):
n = int(input())
ans = 0
for i in range(1, n+1):
    if i%3 == 0 or i%5==0:
        pass
    else:
        ans += i
print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in range(1, n+1):
    if i%3 == 0 or i%5==0:
        pass
    else:
        ans += i
print(ans)

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

print(sum)

Solution (Python):
n = int(input())
c = 0

while n > 0:
    if n % 3 != 0 and n % 5 != 0:
        c += n
    n -= 1

print(c)

Solution (Python):
n=int(input())
s=[]
for i in range(1,n+1):
  if i%3==0:
    continue
  elif i%5==0:
    continue
  else:
    s.append(i)
print(sum(s))

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

Solution (Python):
n = int(input())
ns = []
for ni in range(n):
  ns.append(len(ns)+1)
fb = []
for nf in ns:
  if nf % 3 != 0 and nf % 5 != 0:
    fb.append(int(nf))
print(sum(fb))

Solution (Python):
N=int(input()) 
print(sum( [ i for i in range(1,N+1) if i%(3*5)!=0 and i%(5)!=0 and i%(3)!=0 ]) )

Solution (Python):
n = int(input())
a = []
lists = []
for i in range(1, n+1):
    if i % 3 == 0 and i % 5 == 0:
        a.append('FizzBuzz')
    elif i % 3 == 0:
        a.append('Fizz')
    elif i % 5 == 0:
        a.append('Buzz')
    else:
        a.append(str(i))

for item in a:
    item = item.replace('FizzBuzz', '0')
    item = item.replace('Fizz', '0')
    item = item.replace('Buzz', '0')
    lists.append(item)

print(sum([int(i) for i in lists]))

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

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

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

Solution (Python):
N = int(input())
count = 0
for i in range(1,N+1):
    if i%3 == 0 or i%5 == 0:
        continue
    else:
        count += i
print(count)

Solution (Python):
N = int(input())

ans = 0

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

print(ans)

Solution (Python):

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

Solution (Python):
n = int(input())
a = 0
for i in range(1,n+1):
    if not(i % 3 == 0 or i % 5 == 0):
        a += i
print(a)

Solution (Python):
n = int(input())
a = 0
for i in range(1,n+1):
    if not(i % 3 == 0 or i % 5 == 0):
        a += i
print(a)

Solution (Python):
N = int(input())


def sum(n):
    return (n + 1) * n // 2


print(sum(N) - sum(N // 3) * 3 - sum(N // 5) * 5 + sum(N // 15) * 15)

Solution (Python):
N = int(input())
total = 0
for num in range(1, N+1):
  if num % 15 == 0:
    continue
  if num % 3 == 0 or num % 5 == 0:
    continue
  total += num
print(total)

Solution (Python):
N = int(input())

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

print(ans)

Solution (Python):
N = int(input())
ans = 0

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

print(ans)

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

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

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

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

Solution (Python):
n = int(input())
c = 0
for i in range(1,n + 1):
    if i % 3 != 0 and i % 5 != 0:
        c = c + i

print(c)

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

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

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

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

Solution (Python):
n = int(input())

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

Solution (Python):
n = int(input())

l = []
for i in range(1,n+1):
  if i % 3 == 0:
    continue
  elif i % 5 == 0:
    continue
  else:
    l.append(i)

print(sum(l))

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

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

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

Solution (Python):
n = int(input())
a = 0

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

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

Solution (Python):
n = (int)(input())
ret = 0
for i in range(n+1):
    if i % 3 != 0 and i % 5 != 0:
        ret += i 

print("{}".format(ret))

Solution (Python):

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

Solution (Python):
N = int(input())
ans = 0
for n in range(1, N + 1):
    if n % 3 == 0 or n % 5 == 0:
        continue
    ans += n
print(ans)

Solution (Python):
N = int(input())

count = 0

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

Solution (Python):
n = int(input())
l = []
for i in range(n):
  if (i+1)%3 != 0 and (i+1)%5 != 0:
    l.append(i+1)
  else:
    l.append(0)
print(sum(l))

Solution (Python):
N = int(input())
Count = 0
for T in range(1,N+1):
    if not (T%3==0 or T%5==0):
        Count = Count+T
print(Count)

Solution (Python):
def solve():
    N = int(input())
    suma = 0
    for i in range(N+1):
        if i % 3 != 0 and i % 5 != 0:
            suma += i
    print(suma)

if __name__ == '__main__':
    solve()

Solution (Python):
N=int(input())

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

Solution (Python):
sm=0
for i in range(1,int(input())+1):
  if (i%3)*(i%5)>0:
    sm+=i
print(sm)

Solution (Python):
n=int(input())
sm=0
for i in range(1,n+1):
  if (i % 3)*(i%5)>0:
    sm+=i
print(sm)

Solution (Python):
import math
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    ans=0
    for i in range(1,n+1):
        if i%3==0 or i%5==0:
            pass
        else:
            ans+=i
    print(ans)
if __name__ == '__main__':
    do()

Solution (Python):
N=int(input())

ans=0

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

print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n+1):
  if i % 3 == 0 and i % 5 == 0:
    ans += 0
  elif i % 3 == 0 or i % 5 == 0:
    ans += 0
  else:
    ans += i

print(ans)

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

Solution (Python):
sm=0
for i in range(1,int(input())+1):
  if i % 3 !=0 and i % 5 != 0:
    sm+=i
print(sm)

Solution (Python):
N = int(input())
total = 0
for i in range(1,N+1):
  if i%3 == 0 or i%5 == 0:
    continue
  total += i
print(total)

Solution (Python):
N =int(input())
i =1
a =0
while i <= N:
	if i%3 != 0 and i%5 != 0:
		a +=i
	i +=1
print(a)

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

Solution (Python):
N = int(input())
res =0
for i in range(N+1):
    if i%3 ==0 or i%5 ==0:
        pass
    else:
        res += i
print(res)

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

Solution (Python):
N = int(input())
sum = 0
for i in range(1,N+1,1):
  if i%3==0 or i%5==0:
  	continue
  sum += i

print(sum)

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

Solution (Python):
N=int(input())

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

Solution (Python):
N = int(input())
total = 0
for i in range(1, N+1):
    if i % 3 == 0 or i % 5 == 0:
        continue
    else:
        total += i
print(total)

Solution (Python):
n = int(input())
ans = 0

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

print(ans)

Solution (Python):
N = int(input())
seq = [i for i in range(1,N+1)]
count = 0
for t in range(0,N):
	if seq[t]%3 != 0 and seq[t]%5 != 0:
		count += seq[t]
print(count)

Solution (Python):

import sys


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



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
ans = 0

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

print(ans)

Solution (Python):
N = int(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))

Solution (Python):
n = int(input())

fb = 0

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

print(fb)

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

main()

Solution (Python):

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

Solution (Python):
N = int(input())
c = 0
for i in range(1, N+1):
  if i%3 !=0 and i%5 !=0:
    c += i
print(c)

Solution (Python):
def actual(n):
    amount = 0

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

    return amount

n = int(input())
print(actual(n))

Solution (Python):


n = int(input())

r = 0

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

print(r)

Solution (Python):
N = int(input())
count = 0
for i in range(1,N+1):
    if (i%5==0)|(i%3==0):
        continue
    else:
        count+=i
print(count)

Solution (Python):
N=int(input())
res=0
for i in range(1,N+1):
    if i%3!=0 and i%5!=0:
        res+=i
print(res)

Solution (Python):
n = int(input())
ans = 0;

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

print(ans)

Solution (Python):
n = int(input())
s = 0
for i in range(1, n+1):
    if i % 3 == 0 and i % 5 == 0:
        continue
    elif i % 3 == 0:
        continue
    elif i % 5 == 0:
        continue
    else:
        s+=i
print(s)

Solution (Python):
n = int(input())
s = 0
for i in range(n + 1):
    if (i % 3 == 0) | (i % 5 == 0):
        continue
    s += i
print(s)

Solution (Python):
N = int(input())
s = 0
for i in range(1, N+1):
  if (i%3 != 0) and (i%5 != 0):
    s += i
print(s)

Solution (Python):

n = int(input())

s = 0

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

Solution (Python):
N = int(input())
count = 0

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

print(count)

Solution (Python):
n = int(input())
arr = []
for i in range(1, n + 1):
  if i % 3 == 0 or i % 5 == 0:
    next
  else:
    arr.append(i)
print(sum(arr))

Solution (Python):

N = int(input())

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

print(sum_)

Solution (Python):
N = int(input())
ls = []
for i in range(N+1):
    if i%3==0 or i%5==0:
        pass
    else:
        ls.append(i)
print(sum(ls))

Solution (Python):
N = int(input())
sum = 0
for i in range(N):
  n = i+1
  if n%3 == 0:
    a = 'Fizz'
    continue
  elif n%5 == 0:
    a = 'Buzz'
    continue
  else :
    a = n
  sum = sum + a
print(sum)

Solution (Python):
N=int(input())
goukei=0
for i in range(1,N+1):
    if i%3!=0 and i%5!=0:
        goukei+=i

print(goukei)

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

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

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

Solution (Python):
x=0
for i in range(int(input())+1):
  if i%3!=0 and i%5!=0:
    x+=i
print(x)

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

Solution (Python):
n = int(input())
Arr = []
for i in range(n):
    if ((i+1) % 3 != 0) and ((i+1) % 5 != 0):
        Arr.append(i+1)
print(sum(Arr))

Solution (Python):
n=int(input())
a=n//3
b=n//5
c=n//15
s=n*(n+1)/2-3*a*(1+a)/2-5*b*(1+b)/2+15*c*(1+c)/2
print(int(s))

Solution (Python):
n = int(input(""))
s1= []
s2 = []

for i in range(1,n+1):
    if i % 15 != 0:
        s1.append(i)

for j in s1 :
    if j % 3 == 0 and j % 5 != 0 :
        s2.append(j)
    elif j % 5 == 0 and j % 3 != 0:
        s2.append(j)

a1 = sum(s1)
a2 = sum(s2)
i = int(abs(a1-a2))
print(i)

Solution (Python):
N = int(input())
print(sum([i for i in range(1, N+1) if i%3 != 0 and i%5 != 0]))

Solution (Python):
n = int(input())
lst = [i for i in range(1, n+1) if i % 3 != 0 and i % 5 != 0]
print(sum(lst))

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

Solution (Python):
n= int(input())
def wg(t):
    tp=n//t
    return t*(tp*(tp+1)//2)
print(n*(n+1)//2-wg(3)-wg(5)+wg(15))

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

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

Solution (Python):

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = np.arange(1, N+1)
A = A[A%3 != 0]
A = A[A%5 != 0]
answer = A.sum()
print(answer)

Solution (Python):
N = int(input())
fizzbuzz = []

for i in range(1, N+1):
    if i % 3 != 0 and i % 5 != 0:
        fizzbuzz.append(i)

print(sum(fizzbuzz))

Solution (Python):
N = int(input())
ans = 0
for i in range(1,N+1):
  if i%3 == 0 or i%5 == 0:
    continue
  ans += i
  
print(ans)

Solution (Python):
n=int(input())
ans=0
for i in range(1,n+1):
  if i%3==0 and i%5==0:
    i='FizzBuzz'
  elif i%3==0:
    i='Fizz'
  elif i%5==0:
    i='Buzz'
  else:
    ans=i+ans
print(ans)

Solution (Python):
print(sum([(i if i % 3 and i % 5 else 0) for i in range(int(input()) + 1)]))

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

Solution (Python):
N=int(input())
c=N//15
a=N%15
k=60*(c**2)
for i in range(c*15,N+1):
  if i%3!=0 and i%5!=0:
    k+=i
print(k)

Solution (Python):
n = int(input())
sum_ = 0

for i in range(1, n+1):
    if i % 3 == 0 and i % 5 == 0:
        pass
    elif i % 3 == 0:
        pass
    elif i % 5 == 0:
        pass
    else:
        sum_ += i
        
print(sum_)

Solution (Python):
N = int(input())
a = []
for i in range(N + 1):
  if i % 3 != 0 and i % 5 != 0:
    a.append(i)
    
print(sum(a))

Solution (Python):
N = int(input())

total = 0
for i in range(1, N+1):
    if i%3==0 and i%5==0:
        continue
    elif i%3==0:
        continue
    elif i%5==0:
        continue
    else:
        total +=i
print(total)

Solution (Python):
n = int(input())
l = []

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

l_filter = [l[i] for i in range(len(l)) if type(l[i]) == int]
print(sum(l_filter))

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

Solution (Python):
x = int(input())
sum = 0

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


print(sum)

Solution (Python):
n=int(input())
s=0
for i in range(n+1):
    if i%3==0 and i%5==0:
        s=s
    elif i%3==0:
        s=s
    elif i%5==0:
        s=s
    else:
        s=s+i
print(s)

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

Solution (Python):
N = int(input())
ans = 0
for a in range(N+1):
    if a % 3 == 0 and a % 5 == 0:
        continue
    elif a % 3 == 0:
        continue
    elif a % 5 == 0:
        continue
    else:
        ans += a
print(ans)

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

Solution (Python):
N = int(input())
tot_sum = 0
for val in range(1, N + 1):
    if (val % 5 == 0) or (val % 3 == 0):
        continue
    else:
        tot_sum += val

print(tot_sum)

Solution (Python):
N = int(input())

a = list(range(N+1))
b = list(range(0 ,N+1 ,3))
c = list(range(0 ,N+1 ,5))
d = list(range(0 ,N+1 ,15))

print(sum(a)+sum(d)-sum(c)-sum(b))

Solution (Python):
t=int(input())
S=0
for i in list(range(t+1)):
  if i%5!=0 and i%3!=0:
    S += i
print(S)

Solution (Python):
n = int(input())
ans = 0

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

Solution (Python):
n = int(input())
sum = 0

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

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math
import sys
import collections

mod = 10**9+7
sys.setrecursionlimit(mod) 

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

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

print(ans)

Solution (Python):


N = int(input().split()[0])
total = 0

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

ans = total
print(ans)

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