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):
n = int(input())

l = []

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

print(sum(l))

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

Solution (Python):
n = int(input())
tmp = n // 15
tmp2 = n % 15
d = [(15*(tmp) + i) for i in [0,1,2,0,4,0,0,7,8,0,0,11,0,13,14]]
for i in [0,3,5,6,9,10,12]:
    d[i] = 0
print((tmp **2 * 60) + sum(d[:(tmp2+1)]))

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

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

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

Solution (Python):
n = int(input())
 
total = 0
three = 3 
five = 5
threefive = 15 
for i in range(1, n + 1):
    if i == threefive:
        three += 3 
        five += 5
        threefive += 15
        continue 
    if i == three:
        three += 3 
        continue 
    if i == five:
        five += 5
        continue 
    total += i 





print(total)

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

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

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(1,n+1):
  if i%3 !=0 and i%5 !=0:
    sum += i
print(sum)

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

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

Solution (Python):
N = int(input())
[a,b] = [N // 15,N % 15]
S = 60*a*a
if b == 0:
  print(S)
else:
  for i in range(1,b+1):
    if i % 3 != 0 and i % 5 != 0:
      S += 15*a+i
  print(S)

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

print(ans)

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())

ans = 0

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

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

fiz = N // 3
buz = N // 5
fizbuz = N // 15


fiz_m = 0
buz_m = 0
fizbuz_offset = 0


for i in range(1,fiz+1):
    fiz_m += i*3

for j in range(1,buz+1):
    buz_m += j*5

for l in range(1,fizbuz+1):
    fizbuz_offset += l*15

total = 0
for num in range(1,N+1):
    total += num

result = total - fiz_m - buz_m + fizbuz_offset
print(result)

Solution (Python):
b=int(input())
sum=0
for a in range(0,b+1):
    if a%3 ==0 or a%5==0:
        pass
    else:
        sum+=a
print(sum)

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

print(sums)

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):
def main():
    n = int(input())
    ans = 0
    for i in range(1, n+1):
        if (i%3==0) and (i%5==0):
            continue
        if (i%3==0):
            continue
        if (i%5==0):
            continue
        ans += i
    print(ans)
main()

Solution (Python):




def main():
    n = int(input().strip())

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


if __name__ == '__main__':
    main()

Solution (Python):

import sys

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())

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())

sum=0
for i in range(n+1):
  sum=sum+i

fizzbuzz=0
m=n//15
for i in range(m+1):
  fizzbuzz=fizzbuzz+15*i

fizz=0
l=n//3
for i in range(l+1):
  fizz=fizz+3*i

buzz=0
o=n//5
for i in range(o+1):
  buzz=buzz+5*i

print(sum-fizz-buzz+fizzbuzz)

Solution (Python):
N=int(input())
X= N*(2+(N -1)) / 2
k1=N//3
k2=N//5
k3=N//15
a=k1*(3+(k1)*3)/2
b=k2*(5+(k2)*5)/2
c=k3*(15+(k3)*15)/2
print(int(X-a-b+c))

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())
a = list(range(1,n+1))
ans = sum(a) - sum(list(range(0, n+1, 3))) - sum(list(range(0, n+1, 5))) + sum(list(range(0, n+1, 15)))
print(ans)

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

Solution (Python):



def run():
    n = int(input())
    num = 0
    for i in range(n + 1):
        if i % 3 == 0 or i % 5 == 0:
            continue
        num += i
    print(num)


if __name__ == '__main__':
    run()

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

Solution (Python):
n = int(input())
a = 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:
        a += i
print(a)

Solution (Python):
import math
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)

N = ni()
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:
        s += i
print(s)

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

print(sum)

Solution (Python):

N = int(input())

sums = 0
for i in range(1, N+1):
    if i % 3 == 0:
        continue

    elif i % 5 == 0:
        continue
    else:
        sums += i

print(sums)

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

print(sum(C))

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

ans = N*(N+1)//2

t = N // 3
s = N // 5
u = N // 15

ans = ans - 3*t*(t+1)//2 - 5*s*(s+1)//2 + 15*u*(u+1)//2

print(ans)

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

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

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

    print(sum)

if __name__ == "__main__":
    resolve()

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

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())
a = 0
for x in range(n+1):
    if x % 3 == 0 and  x % 5 == 0 :
        continue
    if x % 3 == 0:
        continue
    if x % 5 == 0 :
        continue
    a += x
print(a)

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

Solution (Python):
n=int(input())
cnt=0
mis=0
for j in range(1,n+1):
    cnt+=j
for i in range(n+1):
    if i%3==0 or i%5==0:
        mis+=i

print(cnt-mis)

Solution (Python):
N = int(input())
S=0
for i in range(1,N+1):

	if i%3==0 or i%5==0 :
		continue
	else:
		S+=i

print(S)

Solution (Python):
a = int(input())
li = list(range(1, (a + 1)))
for i in range(a):
    if li[i] % 3 == 0 or li[i] % 5 == 0 or li[i] % 15 == 0:
        li[i] = 0
print(sum(li))

Solution (Python):
import sys

if __name__ == "__main__":
	N = int(input())

	sum = 0

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

	print(sum)

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

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

Solution (Python):
n=int(input())
lst = list(range(n))
sum = 0

for i in lst:
    calc = lst[i]+1

    if calc % 3 == 0 or calc % 5 == 0:
        continue
    else:
        sum += calc
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
    else:
        sum_ += i
print(sum_)

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

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

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())


def sums(t,i):
    return int(0.5 * (n // i) * (i * 2 + i * ((n // i) -1)))

print(sums(n,1) - sums(n,3) -sums(n,5) + sums(n,15))

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):
def sum(x):
    a=int(x//3)
    b=int(x//5)
    c=int(x//15)
    sall=int((1+x)*(x/2))
    
    s3=int((3*(a-1)+6)*(a/2))
    
    s5=int((5*(b-1)+10)*(b/2))
    
    s15=int((15*(c-1)+30)*(c/2))
    
    ans=int(s15-s3-s5+sall)
    print(ans)
n=int(input())
sum(n)

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())
i = 1
total = 0
while(N >= i):
    total += i if i%3!=0 and i%5!=0 else 0
    i+=1
print(total)

Solution (Python):
a = int(input())
sum = a*(a+1)/2
b = a//3
c = a//5
d = a//15

sum3 = 3*b*(b+1)/2
sum5 = 5*c*(c+1)/2
sum15 = 15*d*(d+1)/2

sum = sum - sum3 - sum5 + sum15
print(int(sum))

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

N = int(read())
x = np.arange(1, N + 1, dtype=np.int64)
x[x % 3 == 0] = 0
x[x % 5 == 0] = 0
print(x.sum())

Solution (Python):
N = int(input())
lst = []
for i in range(1, N + 1):
    if (i % 3) == 0 or (i % 5) == 0:
        pass
    else:
        lst.append(i)
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())

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().split()[0])
all_sum = int(N * (N+1) / 2)

for i in range(3, N+1, 3):
    all_sum -= i

for i in range(5, N+1, 5):
    all_sum -= i

for i in range(15, N+1, 15):
    all_sum += i

print(all_sum)

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

s = 0
for i in range(1, n + 1):
    if not i % 3 == 0 and not 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())
wa = 0.5*n*(n+1)
Fizz_num = n//3
Fizz_sum = sum([3*i for i in range(1,Fizz_num+1)])
Buzz_num = n//5
Buzz_sum = sum([5*i for i in range(1,Buzz_num+1)])
FizzBuzz_num = n//15
FizzBuzz_sum = sum([15*i for i in range(1,FizzBuzz_num+1)])

ans = wa - (Fizz_sum+Buzz_sum) + FizzBuzz_sum

print(int(ans))

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

Solution (Python):
n = int(input())
ans = (n*(n+1))/2
n3 = n // 3
n5 = n // 5
n15 = n // 15

for i in range(n3):
    ans -= 3 * (i+1)
for i in range(n5):
    ans -= 5 * (i+1)
for i in range(n15):
    ans += 15 * (i+1)
print(int(ans))

Solution (Python):
n = int(input())
num = sum(list(range(n+1)))

a = int(n/3)
a = sum(list(range(a+1)))

b = int(n/5)
b = sum(list(range(b+1)))

c = int(n/15)
c = sum(list(range(c+1)))

print(num-(3*a)-(5*b)+(15*c))

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

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

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

sum = 0
for i in range(1,n+1):
    if i % 15 == 0:
        continue
    elif i % 3 == 0:
        continue
    elif i % 5 == 0:
        continue
    else:
        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:
        pass
    else:
        ans += i
print(ans)

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

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

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

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

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

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

fizzbuzzlist = range(N+1)
fizzbuzzlist = [i for i in fizzbuzzlist if i % 3 != 0]
fizzbuzzlist = [i for i in fizzbuzzlist if i % 5 != 0]

print(str(sum(fizzbuzzlist)))

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(1, N+1):
    if not (i%3 == 0 or i%5 == 0):
        ans += i

print(ans)

Solution (Python):

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

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

i = 1
li = []
for j in range(N):
    if ((i % 3) == 0) or ((i % 5) == 0):
        i = i + 1
    else:
        li.append(i)
        i = i + 1
        
print(sum(li))

Solution (Python):
n = int(input())
total = n * (n + 1) // 2
fizz = n // 3 * (n // 3 + 1) // 2 * 3
buzz = n // 5 * (n // 5 + 1) // 2 * 5
fizzbuzz = n // 15 * (n // 15 + 1) // 2 * 15
print(total - fizz - buzz + fizzbuzz)

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

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=1
s=0
for k in range(N):
    if a%3!=0 and a%5!=0:
        s+=a
    a+=1
print(s)

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

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

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

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

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

Solution (Python):



def solve(*args: str) -> str:
    n = int(args[0])

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

    return str(ret)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

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

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

Solution (Python):
N = int(input())
sequence = list(range(1, N + 1))
for i in range(len(sequence)):
    num = sequence[i]
    if num % 3 == 0 and num % 5 == 0:
        sequence[i] = "FizzBuzz"
    elif num % 3 == 0:
        sequence[i] = "Fizz"
    elif num % 5 == 0:
        sequence[i] = "Buzz"
total = 0
for i in sequence:
    if isinstance(i, int):
        total += i
print(total)

Solution (Python):
def sum_cnt(max_num):
    cnt = 0
    for i in range(max_num):
        cnt += (i+1)
    return cnt
def sum_cal(n, num):
    q = n//num
    return num*sum_cnt(q)

n = int(input())
sum_all = n*(n+1)//2
sum_5 = sum_cal(n, 5)
sum_3 = sum_cal(n, 3)
sum_15 = sum_cal(n, 15)
print(sum_all - (sum_5+sum_3) + sum_15)

Solution (Python):
N = int(input())
all_sum = int(N / 2 * (N + 1))
i = 1
while i <= N:
	if i % 3 == 0 and i % 5 == 0:
		all_sum -= i
	elif i % 3 == 0:
		all_sum -= i
	elif i % 5 == 0:
		all_sum -= i
	i += 1
print(all_sum)

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

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

Solution (Python):
N = int(input())
sum1 = 0
a = list(range(1,N + 1,1))

for i in a:
    if i%3 != 0 and i%5 != 0:
        sum1 = sum1 + i

print(sum1)

Solution (Python):
input_line = int(input())
fizzbuzz_list = []

for i in range(input_line + 1):
    if i % 15 == 0 or i % 5 == 0 or i % 3 == 0:
        pass
    else:
        fizzbuzz_list.append(i)
print(sum(fizzbuzz_list))

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

is_Fizz = lambda number: number % 3 == 0
is_Buzz = lambda number: number % 5 == 0

answer = 0
for i in range(N + 1):
    if is_Fizz(i) or is_Buzz(i): continue
    
    answer += i

print(answer)

Solution (Python):
n = int(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 += 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 =sum+i
print(sum)

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())
ans=0
for i in range(1,n+1):
    if i%3==0:
        continue
    if i%5==0:
        continue
    ans+=i
print(ans)

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

def fz(n):
    if n % 3 == 0:
        return 0
    elif n % 5 == 0:
        return 0
    else:
        return n

def fzsum(n):
    return sum([fz(i + 1) for i in range(n)])

print(fzsum(N))

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
t=0
u=0
v=0
for i in range(1,n+1):
  s = s+i
  if i%3==0:
    t = t+i
  elif i%5==0:
    u = u +i
  elif v %15==0:
    v = v+i
print(s-t-u+v-1)

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

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

print(sum)

Solution (Python):
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007



def main():
	n = int(input())
	
	
	r=0
	for i in range(1,n+1):
		if i % 3 == 0 or i % 5 == 0:
			continue
		r+=i
	print(r)
	
	
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):
N=int(input())
answer=0
for i in range(1,N+1):
    if i%15==0:
        pass
    elif i%5==0:
        pass
    elif i%3==0:
        pass
    else:
        answer+=i
        
print(answer)

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())
res = 0
for i in range(1,n+1):
    if i%3==0 or i%5==0:
        continue
    res += i
print(res)

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

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

Solution (Python):
number = int(input())
outputlist = list()
count = 0
if number >= 1 and number <= 1000000:
    number = number + 1
    for i in range (1, number):
        if i % 3 == 0 and i % 5 == 0:
            outputlist.append("FizzBuzz")
        elif i % 3 == 0:
            outputlist.append("Fizz")
        elif i % 5 == 0:
            outputlist.append("Buzz")
        else:
            outputlist.append(str(i))
    for i in outputlist:
        if i.isdigit() == True:
            count = count + int(i)
        else:
            count = count
    print(count)
else:
    print()

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

Solution (Python):
N=int(input())
ans=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:
        ans+=i
print(ans)

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

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

g = sum(a)
print(g)

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

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

l = [0]*(a+1)
for i in range(a+1):
    if i%3 == 0:
        l[i] = 0
    elif i%5 == 0:
        l[i] = 0
    else:
        l[i] = i

print(sum(l))

Solution (Python):
n=int(input())
i=1
total=0
while i <=n:
    if i%15==0:
        
        total+=0
    elif i%5==0:
        
        total+=0
    elif i%3==0:
        
        total+=0
    else:
        
        total+=i
    i+=1
print(total)

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())
S=[]
for i in range(1,N+1):
    S.append(i)
for j in range(0,len(S)):
    if S[j]%3==0 or S[j]%5==0 or S[j]%15==0:
        S[j]=0
print(sum(S))

Solution (Python):
n=int(input())
sum=n*(n+1)/2
k3=n//3
k5=n//5
k15=n//15
sum-=3*k3*(k3+1)/2
sum-=5*k5*(k5+1)/2
sum+=15*k15*(k15+1)/2
print(int(sum))

Solution (Python):

import sys


def solve(N: int):
    counter = 0
    for i in range(1, N+1):
        if (i % 3 != 0) and (i % 5 != 0):
            counter += i
    print(counter)
    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):
import numpy as np

def main():
    n = int(input())
    all_sum = (n * (n + 1)) // 2
    b_last = n - np.mod(n, 3)
    c_last = n - np.mod(n, 5)
    d_last = n - np.mod(n, 15)
    
    
    
    
    if n >= 3:
        
        
        all_sum -= ((3 + b_last) * ((n - np.mod(n, 3)))) // 6
    else:
        pass
    if n >= 5:
        all_sum -= ((5 + c_last) * ((n - np.mod(n, 5)))) // 10
    else:
        pass
    if n >= 15:
        all_sum += ((15 + d_last) * ((n - np.mod(n, 15)))) // 30
    else:
        pass
    """
    all_sum -= ((3 + b_last) * ((n - np.mod(n, 3)))) // 6
    print(((3 + b_last) * ((n - np.mod(n, 3)))) // 6)
    all_sum -= ((5 + b_last) * ((n - np.mod(n, 5)))) // 10
    print(((5 + c_last) * ((n - np.mod(n, 5)))) // 10)
    all_sum += ((15 + b_last) * ((n - np.mod(n, 15)))) // 30
    print(((15 + d_last) * ((n - np.mod(n, 15)))) // 30)
    """
    ans = all_sum

    print(ans)
    
if __name__ == '__main__':
    main()

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())
sum = 0
for i in range(n):
    if (i+1) %3 != 0 and (i+1) %5 != 0:
        sum += (i+1)
 
print(sum)

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

ans = 0
for i in range(S+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 = sum + i

print(sum)

Solution (Python):
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+1):
    if check(i):
        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

print(ans)

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

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

total = [i for i in range(1, n + 1)]
fizz = [i for i in range(1, n + 1) if i % 3 == 0]
buzz = [i for i in range(1, n + 1) if i % 5 == 0]
fizzbuzz = [i for i in range(1, n + 1) if i % 15 == 0]

ans = sum(total) - sum(fizz) - sum(buzz) + sum(fizzbuzz)
print(ans)

Solution (Python):
x = int(input()) + 1
count = 0
for i in range(x):
  if i % 3 == 0:
    pass
  elif i % 5 == 0:
    pass
  else:
    count += i

print(count)

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())
s=0
p=1
for i in range(n):
  m=i+1
  if not(p)%3==0 and not (p)%5==0:
    s=s+m
  i=i+1
  p=p+1
  if p%15==0:
    p=0
print(s)

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

initial = 1+2+4+7+8+11+13+14

max_per = int((n+1)//15)

ans = 0

ans+= (max_per*initial + 8*15*(max_per-1)*max_per/2)


left = n - 15*max_per

if left<=0:
    print(int(ans))
else:
    for i in range(left):
        cand = 15*max_per + i+1
        if (cand%3!=0) & (cand%5!=0):
            ans+= cand
    print(int(ans))

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

sum = 0

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

print(sum)

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

N_3 = int(N / 3)
N_5 = int(N / 5)
N_15 = int(N / 15)

def sumN(n):
    return int(n * (n + 1) / 2)

print(sumN(N) - sumN(N_3) * 3 - sumN(N_5) * 5 + sumN(N_15) * 15)

Solution (Python):
n = int(input())
s3 = 0
s5 = 0
s15 = 0
count = 0
for i in range(int(n / 3)):
    s3 += (i+1) * 3
for i in range(int(n / 5)):
    s5 += (i + 1) * 5
for i in range(int(n / 15)):
    s15 += (i + 1) * 15
for i in range(n):
    count += (i+1)
print(count-s3-s5+s15)

Solution (Python):
def sums(n):
    return n * (n + 1) // 2


def main():
    n = int(input())
    print(sums(n) - (3 * sums(n // 3) + 5 * sums(n // 5) - 15 * sums(n // 15)))


main()

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

Solution (Python):
sum_num = int(input())
result = 0
for num in range(1, sum_num + 1):
	if not ((num % 3 == 0 and num % 5 == 0) or num % 3 == 0 or num % 5 == 0):
		result = result + num
	else:
		continue
print(str(result))

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

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

S = 0

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

Solution (Python):
n = int(input().strip())
result = (1 + n) * n // 2
i = 1
while i * 3 <= n:
    result -= i * 3
    i += 1
i = 1
while i * 5 <= n:
    if (i * 5) % 3 != 0:
        result -= i * 5
    i += 1
print(result)

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

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

print(S)

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

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

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())
def judge(x):
    if x%3==0 or x%5==0:
        return False
    return True
sum=0
for i in range(n+1):
    if judge(i):
        sum+=i
print(sum)

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):
def main():
    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)


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=0
for i in range(1,n+1):
    if i%3!=0 and i%5!=0:
        sum=sum+i
print(sum)

Solution (Python):
import sys,math,copy,queue,itertools,bisect
sys.setrecursionlimit(10**7)
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
_LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
INF = 10**18
MOD = 10**9 + 7
DD = ((1,0),(0,1),(-1,0),(0,-1))
m = [0,1,3,3,7,7,7,14,22,22,22,33,33,46,60]
x = [0,1,2,2,3,3,3,4,5,5,5,6,6,7,8]
N = NI()

a = N // 15
b = (a)*(a-1) * 60 + a*60
c = N % 15
d = (a) * 15 * x[c]  + m[c]
ans = b + d
print (ans)