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

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

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 i%3 != 0 and i %5 != 0:
        ans += i
print(ans)

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

Solution (Python):



N = int(input())



result = 0
for n in range(1, N+1):
    if (n % 3 == 0) or (n % 5 == 0):
        continue
    result += n


print(result)

Solution (Python):
N = int(input())
s =  int(0.5 * (N) * (1 + N))
f = int(0.5 * (N//3) * (1 + N // 3) * 3)
b = int(0.5 * (N//5) * (1 + N // 5) * 5)
fb = int(0.5 * (N//15) * (1 + N // 15) * 15)

print(s-f-b+fb)

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())
A=N-N%3
B=N-N%5
C=N-N%15
a=A//3
b=B//5
c=C//15
print((1+N)*N//2-((3+A)*a//2+(5+B)*b//2-(15+C)*c//2))

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

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

sum3 = N // 3
sum3 = sum3 * (3 + sum3 * 3) // 2
sum5 = N // 5
sum5 = sum5 * (5 + sum5 * 5) // 2
sum15 = N // 15
sum15 = sum15 * (15 + sum15 * 15) // 2

print(total - sum3 - sum5 + sum15)

Solution (Python):

import sys


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

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

Solution (Python):
def solve(n):
    res = 0
    for i in range(1, n + 1):
        if i % 3 == 0 or i % 5 == 0:
            continue
        else:
            res += i
    return res


def main():
    n = int(input())
    res = solve(n)
    print(res)


def test():
    assert solve(15) == 60
    assert solve(1000000) == 266666333332


if __name__ == "__main__":
    test()
    main()

Solution (Python):


def solve():
    N = int(input())
    res = N*(N+1)//2 - 3*(N//3)*((N//3)+1)//2 - 5*(N//5)*((N//5)+1)//2 + 15*(N//15)*((N//15)+1)//2
    return str(res)


if __name__ == '__main__':
    print(solve())

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

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

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

Solution (Python):


N = int(input())

S = 0

for i in range(N):
    i = i + 1
    if i%15==0 or i%3==0 or i%5==0:
        ans = "o"
    else:
        S += i

print(S)

Solution (Python):
n=int(input())
res=0
F=0
for i in range(1,n+1):
    if i%3==0 or i%5==0:
        F+=i
    else:
        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):
a=int(input())
b=[i+1 for i in range(a)]
for i in range(a):
    if   b[i]%3==0 or b[i]%5==0:
        b[i]=0
print(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=0
for i in range(1,n+1):
    if i%3==0:
        continue
    elif i%5==0:
        continue
    else:
        a+=i
print(a)

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

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

Solution (Python):
n = int(input())
ans = sum(list(range(1, n+1)))
n_3 = n//3
n_5 = n//5
n_15 = n//15
for i in range(1, n_3+1):
  ans -= i*3
for i in range(1, n_5+1):
  ans -= i*5
for i in range(1, n_15+1):
  ans += i*15
print(ans)

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
  a = int(input())
  ans = 0
  for i in range(a):
    if (i+1)%3 == 0 or (i+1)%5 == 0:
      continue
    ans += (i+1)
  print(ans)
if __name__ == '__main__':
  main()

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

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

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

print(k)

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

cnt=0

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

print(cnt)

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())
n = (N+1)*N/2 - int(N/5)*(5+N-N%5)/2 - int(N/3)*(3+N-N%3)/2 + int(N/15)*(15+N-N%15)/2
print(int(n))

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

loop = n//15
ans += loop * 60 + 120*(loop-1)*loop//2
res = n % 15
for i in range(1,res+1):
  if i%3 != 0 and i%5 != 0:
    ans += 15*loop + i
  
print(ans)

Solution (Python):
N = int(input())
total = sum(range(N + 1))

fizz_total = sum(range(0, N + 1, 3))
buzz_total = sum(range(0, N + 1, 5))
fizzbuzz_total = sum(range(0, N + 1, 15))

print(total - fizz_total - buzz_total + fizzbuzz_total)

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

res = []

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

    else:
        res.append(num)

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

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

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

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

def fizbuz(n):
  if n%3==0 or n%5==0:
    return 0
  else:
    return n
    
NFZBZ = [n for n in range(1,N+1) if fizbuz(n)]
print(sum(NFZBZ))

Solution (Python):
a=int(input())
sum=0
num=1
while num<=a:
    if num%3==0:
        pass
    elif num%5==0:
        pass
    else:
        sum+=num
    num+=1
print(sum)

Solution (Python):
n=int(input())
f=n//3
b=n//5
fb=n//15

def sumt(x):
    return x*(x+1)//2

ans = sumt(n)-3*sumt(f)-5*sumt(b)+15*sumt(fb)
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())
num = 0
i = 1
while i <=n:
    if  i%3 != 0 and i%5 != 0: 
        num += i
    i += 1
print(num)

Solution (Python):
import sys

N =  int(input())

cnt = 0
a = N//3
b = N//5
for i in range(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 and i % 5 != 0:
    ans += i
print(ans)

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

def sumn(x):
    return int((1/2)*x*(x+1))

K3 = N - N%3
K5 = N - N%5
K15 = N- N%15

print(sumn(N)-sumn(K3/3)*3-sumn(K5/5)*5+sumn(K15/15)*15)

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 i % 3 != 0 and i % 5 != 0:
        ans += i
print(ans)

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

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

print(X)

Solution (Python):

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



main()

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

a = range(1,n+1,1)

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

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

ans = []

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

print(sum(ans))

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

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

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

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

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

print(int(sum))

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

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

Solution (Python):
n = int(input())
li = set()
ali = set()
bli = set()
for i in range(n//3):
    ali.add(3*(i+1))
for j in range(n//5):
    bli.add(5*(j+1))
for k in range(n):
    li.add(k+1)
print(sum(li)-sum(ali | bli))

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

print(ans)

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

anslist = [0]
i = 1
while i < (N+1):
    if i % 15 == 0:
        a=1
    elif i % 3 == 0:
        a=1
    elif i % 5 == 0:
        a=1        
    else:
        anslist.append(i)
    i += 1
    
b = sum(anslist)

print(b)

Solution (Python):
N=int(input())
def sigma(a):
    s=0
    for i in range(0,a+1):
        s+=i
    return(s)
j=N//3
k=N//5
l=N//15
print(sigma(N)-3*sigma(j)-5*sigma(k)+15*sigma(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 = input()

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

print(str(s))

Solution (Python):
N = int(input())
val = (N*(N+1)-3*(N//3)*((N//3)+1)-5*(N//5)*((N//5)+1)+15*(N//15)*((N//15)+1))//2
print(int(val))

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

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

print(ans)

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


print(sum(total))

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

print(sum)

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

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


if __name__ == '__main__':
    main()

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

num = 0

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

print(num)

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):
def solve(p):return int(1/2*p*(p+1))

n = int(input())
p5 = n//5
p3 = n//3
p15 = n//15


print(solve(n)-solve(p3)*3-solve(p5)*5+solve(p15)*15)

Solution (Python):
def calc(number):
    return(int((1 + number) * number / 2))
num = int(input())
sum = calc(num)
divthree = num // 3
divfive = num // 5
divfif = num // 15
sumthree = 3 * calc(divthree)
sumfive = 5 * calc(divfive)
sumfif = 15 * calc(divfif)
print(sum - sumthree - sumfive + sumfif)

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

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):
n = int(input()) 
a = 0
b = 0
for i in range(n+1):
    if i % 3 == 0 or i % 5 == 0 :
        b = 1
    else:
        a = a+ i
        
        
print(a)

Solution (Python):


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby
    
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

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

if __name__ == '__main__':
    main()

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

Solution (Python):



from math import *
from copy import *
from heapq import *
from string import *				
from random import *				
from bisect import *				
from sys import stdin				
from sys import maxsize
from operator import *				
from itertools import *
from collections import Counter		
from collections import defaultdict 

'''

'''

def solve(n):
	ans = 0
	for i in range(1,n+1):
		if(i%3 == 0 == i%5):
			
			x = 1
		elif(i%3 == 0):
			
			z = 1
		elif(i%5 == 0):
			
			z = 1
		else:
			ans += i
	return ans
	

N = int(stdin.readline())
ans = solve(N)
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):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = True

n = INT()
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 or i%5 == 0:
		ans += 0
	else:
		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 = ans + i

print (ans)

Solution (Python):
n = int(input())
three = 3*(n//3)*(n//3+1)//2
five = 5*(n//5)*(n//5+1)//2
fift = 15*(n//15)*(n//15+1)//2
sum = n*(n+1)//2
print(sum-three-five+fift)

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

li = list(range(n + 1))
li3 = [i * 3 for i in list(range(n // 3+1))]
li5 = [i * 5 for i in list(range(n // 5+1))]

li = set(li)
li3 = set(li3)
li5 = set(li5)
print(sum(li.difference(li3, li5)))

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

lst = [_ for _ in  range(1,n+1) if _ % 3 != 0 and _ % 5 != 0]

print(sum(lst))

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 = []
for i in range(1, n+1):
  if i % 3 == 0 or i% 5 == 0 :
    pass
  else :
    ans.append(i)

print(sum(ans))

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

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

print(sum(n_list))

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

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:
        continue
    if i % 5 == 0:
        continue
    ans += i
print(ans)

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

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

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

Solution (Python):
def read():
    N = int(input())
    return N,

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

if __name__ == '__main__':
    inputs = read()
    print("{}".format(solve(*inputs)))

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

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

fb_sum = 0

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

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):
def sum1(N):
    S1 = int((((N // 3)) * (2 * 3 + (N //3 - 1) * 3) //2) )
    S2 = int((((N // 5)) * (2 * 5 + (N // 5 - 1) * 5) // 2) )
    S3 = int((((N // 15)) * (2 * 15+ (N // 15 - 1) * 15) // 2))
    a =  int(S1 + S2 - S3) 
    return a
N = int(input())
ans = (N*(N+1)/2)-sum1(N)
print(int(ans))

Solution (Python):
N = int(input())
c = ["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+1)]
set_c = set(c)
r = 0
for x in range(len(c)):
  if type(c[x]) == type('string'):
    continue
  else:
    r += c[x]

print(r)

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 and i % 5 != 0:
    ans += i
print(ans)

Solution (Python):
N=int(input())
n=list(range(1,N+1,1))
n3=list(range(3,N+1,3))
n5=list(range(5,N+1,5))
n15=list(range(15,N+1,15))
print(sum(n)-sum(n3)-sum(n5)+sum(n15))

Solution (Python):




import sys
input = sys.stdin.readline



def main():
    N = int(input())

    res = 0

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

    print(res)



main()

Solution (Python):

n=int(input())
a=[i for i in range(n+1) if (i%3!=0)and(i%5!=0)and(i%15!=0)]
print(sum(a))

Solution (Python):
N=int(input())
all_sum=N*(N+1)/2
mt=N//3
mf=N//5
mfif=N//15
three_sum=3*mt*(mt+1)/2
five_sum=5*mf*(mf+1)/2
fif_sum=15*mfif*(mfif+1)/2
ans=all_sum-three_sum-five_sum+fif_sum
print(int(ans))

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

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

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

i = 0
ans = 0
while i <= N:
    if i % 3 == 0 or i % 5 == 0:
        ans += 0

    else:
        ans += i

    i += 1

print(ans)

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

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

print(cnt)

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

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):
import queue
import math
import copy
"""
N = int(input())



A = []
for i in range(N):
	A.append(int(input()))

print(A)

"""
a = int(input())
Ans = 0
for i in range(1,a+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 += i
print(ans)

Solution (Python):


n = int(input())

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

Solution (Python):
N = int(input())
s = (N + 1) * N / 2 if N % 2 != 0 else (N - 1) * N / 2 + N

for M,K in zip([N // 3, N // 5],[3,5]):
    s -= K*(M + 1) * M/ 2 if M % 2 != 0 else K*(M - 1) * M / 2 + K*M

M = N // 15
s += 15*(M + 1) * M / 2 if M % 2 != 0 else 15*(M - 1) * M / 2 + 15*M

print(int(s))

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

if __name__ == "__main__":
    main()

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

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

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

print(ans)

Solution (Python):

import sys


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

    sum_count = 0

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

    print(sum_count)

if __name__ == '__main__':
    main()

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

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

A = list(range(1,N+1))
B =[]
for i in A:
    if (i%3==0) and (i%5==0):
        t = 0
    elif (i%3==0):
        t = 0
    elif (i%5==0):
        t = 0
    else:
        t = i 
    B.append(t)
print(sum(B))

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

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

print(ans)

Solution (Python):
a=input()
a=int(a)
sum=0
for i in range(1,a+1):
    if i%5==0 or i%3==0:
        continue
    else :
        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):
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())
sum_n = 0

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

print(sum_n)

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

sum = 0

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

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

allSum = (1 + N) * (N/2)
ko3 = N//3
ko5 = N //5
ko15 = N//15

s3 = 3 * ((1 + ko3) * (ko3/2))
s5 = 5 * ((1 + ko5) * (ko5/2))
s15 = 15 * ((1 + ko15) * (ko15/2))
print(math.floor(allSum - s3 - s5 + s15))

Solution (Python):
N=int(input())
sum=(1+N)*N/2
sum_Fizz=(3+(N//3)*3)*(N//3)/2
sum_Buzz=(5+(N//5)*5)*(N//5)/2
sum_FizzBuzz=(15+(N//15)*15)*(N//15)/2
print(int(sum-sum_Fizz-sum_Buzz+sum_FizzBuzz))

Solution (Python):
N = int(input())
print(sum(range(N+1)) - sum(range(N//3 + 1))*3 - sum(range(N//5 + 1))*5 + sum(range(N//15 +1))*15)

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

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

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

print(cnt)

Solution (Python):
n = int(input())
ans = int(((n+1)*n)/2)
ans -= int(((n-(n%3)+3)*(n//3))/2)
ans -= int(((n-(n%5)+5)*(n//5))/2)
ans += int(((n-(n%15)+15)*(n//15))/2)

print(ans)

Solution (Python):
N = int(input())
fb = [x for x  in range(1, N+1) if not((x%3==0) or (x%5==0))]
print(sum(fb))

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


    return

if __name__ == "__main__":
    main()

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

Solution (Python):

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

Solution (Python):

N = int(input())

res = 0

for i in range(1,N+1):
    if i % 3 == 0:
        continue
    if i % 5 == 0:
        continue
    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
  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):
N=int(input())
i=1
r=0


if(N==1):
  print("1")
elif(N==2):
  print("3")
else:
  while(i<N+1):
    if(i%3!=0):
      if(i%5!=0):
        r+=i
    i+=1
  print(r)

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

Solution (Python):
def main():
  count = 0
  for i in range(1,int(input())+1):
    if i % 3 == 0:
      continue
    if i % 5 == 0:
      continue
    count += i
  return count
    
print(main())

Solution (Python):

N = int(input())

k = N//3
l = N //5
h = N //15

sum3 = (3 * k + 3) * k // 2
sum5 = (5 * l + 5) * l // 2
sum15 = (15 * h + 15) * h // 2
sum = N * (N + 1) // 2
print(sum-sum3-sum5+sum15)

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)  
to_index = lambda x: int(x) - 1  
print_list_in_2D = lambda x: print(*x, sep="\n")  


def input_int():
    return int(input())

def map_int_input():
    return map(int, input())

MII = map_int_input

def MII_split():
    return map(int, input().split())

def MII_to_index():
    return map(to_index, input())

def MII_split_to_index():
    return map(to_index, input().split())


def list_int_inputs():
    return list(map(int, input()))

LII = list_int_inputs

def LII_split():
    return list(map(int, input().split()))


def LII_2D(rows_number):
    return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number):
    return [LII_split() for _ in range(rows_number)]

N = input_int()
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 = []
for i in range(1, N + 1):
    if i % 3 != 0 and i % 5 != 0:
        ans.append(i)

print(sum(ans))

Solution (Python):
n = int(input())
a = n//15
b = n//3
c = n//5
wa = 0
for n in range(n+1):
    wa += n
for n in range(a+1):
    wa +=15*n
for n in range(b+1):
    wa -=3*n
for n in range(c+1):
    wa -=5*n
print(wa)

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

print(res)

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

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

print(s)

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

sum = 0

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

    if n % 5 == 0:
        continue

    if n % 15 == 0:
        continue

    sum += n

print(sum)