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

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

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

Solution (Python):

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

N = int(input())
ans = sum(list(filter(check,range(N + 1))))
print(ans)

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

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

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=int(input())
b=[]

for i in range(a+1):
  if i%3==0:
    continue
  elif i%5==0:
    continue
  else:
    b.append(i)

print(sum(b))

Solution (Python):
k = int(input())
ans=0
for N in range(k+1):
    if N%3==0 and N%5==0:
        N="FizzBuzz"
    elif N%3==0:
        N="Fizz"
    elif N%5==0:
        N="Buzz"
    else:
        ans+=N
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())
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())
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())
total = 0
for i in range(1, N+1):
    if (i % 3) != 0 and (i % 5) != 0:
        total = total+i
print(total)

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

while tmp < n:
    tmp = tmp + 1
    if tmp % 3 != 0 and tmp % 5 != 0:
        ans = ans + tmp
print(ans)

Solution (Python):
def calc(n, N):
    return (n + (N // n * n)) * (N // n) // 2


def main():
    N = int(input())
    print(calc(1, N) - calc(3, N) - calc(5, N) + calc(15, N))
    return


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

print(c)

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

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

print(c)

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())
l = [i for i in range(N+1)  if not i % 3 == 0 and not i % 5 == 0]
print(sum(l))

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

l = []
for i in range(N+1):
    if not i % 3 == 0 and not i % 5 == 0:
        l.append(i)
print(sum(l))

Solution (Python):
N = int(input())
l = [i for i in range(N+1)  if i % 3 != 0 and i % 5 != 0]
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())

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

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

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

    print(count)
resolve()

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

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 S(n):
    return (n*(n+1))//2

def T(n,r):
    return r*S(n//r)
N=int(input())

print(S(N)-T(N,3)-T(N,5)+T(N,15))

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

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

print(totale)

Solution (Python):
N = int(input())
a = list()
for i in range(1,N+1):
    if i %3 != 0 and i%5 != 0:
        a.append(i)
    else:
        continue

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

a = []
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:
    a.append(i)
    
print(sum(a))

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

print(sum(filter(lambda x: x % 3 != 0 and x % 5 != 0, range(1, N + 1))))

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

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

print(sum(FZ))

Solution (Python):



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

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

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

    total += x

print(total)

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

samu = 0

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

print(str(int(samu)))

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

Solution (Python):
n = int(input())
all_sum = n * (n + 1)//2

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

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

sum_not_number = sum_number_3 + sum_number_5 - sum_number_15

s = all_sum - sum_not_number

print(s)

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

print(count)

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

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

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

print(ans)

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

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

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

print(total)

Solution (Python):
N = int(input())
sumN = N*(N+1)/2
sumFizz = ((N//3)*((N//3)+1))*3/2
sumBuzz = ((N//5)*((N//5)+1))*5/2
sumFizzBuzz = ((N//15)*((N//15)+1))*15/2
print(int(sumN - sumFizz - sumBuzz + sumFizzBuzz))

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

print(n)

Solution (Python):
n = int(input())
us = set(i for i in range(1, n + 1))
m3 = set(i for i in range(3, n + 1, 3))
m5 = set(i for i in range(5, n + 1, 5))
print(sum(list(us - m3 - m5)))

Solution (Python):
N = int(input())
result = []
for i in range(1, N+1):
    if(i % 3 == 0):
        pass
    elif(i % 5 == 0):
        pass
    elif(i % 3 == 0 and i % 5 == 0):
        pass
    else:
        result.append(i)

print(sum(result))

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

A = 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:
        A += i

print(A)

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

for i in range(n+1):
    if (not i%3==0) and (not i%5==0):
        total +=i
    else:
        pass

print(total)

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

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

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

Solution (Python):
n=int(input())
a=int(n/15)
b=n%15
num=0
for i in range(a*15,a*15+b+1):
  if i%3!=0 and i%5!=0:
    num+=i
for i in range(a):
  num+=60+(15*8*i)
print(int(num))

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

print(sum(List))

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

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):
from math import floor
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):
import sys
from collections import deque
import copy
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)


if __name__ == '__main__':
    main()

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

total = 0

for i in range(1, n+1):
  if i % 15 == 0:
      continue
  elif i % 3 == 0:
      continue
  elif i % 5 == 0:
      continue
  else:
      total += i
    
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())
 
k = N // 3
l = N // 5
m = N // 15
 
sum = (N * (N + 1) / 2) - (3* k * (k + 1) / 2) - (5* l * (l + 1) / 2) + (15* m * (m + 1) / 2)
print(int(sum))

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

print(ans)

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

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

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

print(ans)

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

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

print(ans)

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

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

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

print(N_sum)

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

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

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

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

print(ans)

Solution (Python):
import sys

def ep(*params):
    print(*params,file=sys.stderr)
    
N = int(input().rstrip())
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())
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())
total = 0
for i in range(1, N+1):
    if i % 3 == 0 and i % 5 == 0:
        FizzBuzz = i
    elif i % 3 == 0:
        Fizz = i
    elif i % 5 == 0:
        Buzz = i
    else:
        j = i
        total = total + j
print (total)

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

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

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

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

print(ans)

Solution (Python):
N = int(input())
N3 = N//3
N5 = N//5
N15 = N//15

S = N * (N+1) // 2
S3 = N3 * (N3+1) // 2 *3
S5 = N5 * (N5+1) // 2 *5
S15 = N15 * (N15+1) // 2 *15

sum = S - (S3 + S5 -S15)
print(sum)

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

s=sum(range(N+1))
s3=sum(range((N//3)+1))*3
s5=sum(range((N//5)+1))*5
s15=sum(range((N//15)+1))*15

print(s-s3-s5+s15)

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

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

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

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

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

Solution (Python):
n=int(input())
li=[]
i=0
while i<=n:
    if i%3!=0 and i%5!=0:
        li.append(i)
        i+=1
        continue
    else:
        i+=1
        continue
else:
    print(sum(li))

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())
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())
cnt = 0

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

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())
list = list(range(1,n+1))

list_Fizz = [i for i in list if i % 3 == 0]
list_Buzz = [i for i in list if i % 5 == 0]
list_FizzBuzz = [i for i in list if i % 15 == 0]

print(sum(list) - sum(list_Fizz) - sum(list_Buzz) + sum(list_FizzBuzz))

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

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

print(cnt)

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

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

        record = []

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

        print(sum(record))


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

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+=i
print(ans)

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

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

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

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

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

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

Solution (Python):
from copy import deepcopy
from sys import stdin

def S(): return stdin.readline().rstrip()
def I(): return int(stdin.readline().rstrip())
def LS(): return list(stdin.readline().rstrip().split())
def LI(): return list(map(int,stdin.readline().rstrip().split()))
def R(x):
    r = round(x)
    if r+0.5 <= x:
        r += 1
    return r

n = I() + 1

l = list(range(n))

i = 3
j = 5
while i < n:
    if 0<l.count(i):
        l.remove(i)
    i *= 3
    if j < n:
        if 0<l.count(j):
            l.remove(j)
        j*=5

ans = 0
for i in range(len(l)):
    if l[i]%3 != 0 and l[i]%5 != 0:
            ans += l[i]

print(ans)

Solution (Python):
N=int(input())
n=1
sum=0
while n<=N :
    if n%5==0 and n%3==0 :
        sum=sum+0
        n+=1
        continue
    elif n%5==0:
        sum=sum+0
        n+=1
        continue
    elif n%3==0:
        sum=sum+0
        n+=1
        continue
    else :
        sum=sum+n
        n+=1
        continue
print(sum)

Solution (Python):
import sys
input = sys.stdin.readline

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)


if __name__ == "__main__":
    main()

Solution (Python):
from sys import stdin, setrecursionlimit


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


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

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

total = 0

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

print(total)

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())
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 fizzBuzz(n):

    if not(n % 3 == 0 or n % 5 == 0):
        return n
    else:
        return 0


ans = 0
for i in range(1, N+1):
    ans += fizzBuzz(i)

print(ans)

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

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

print(total)

Solution (Python):

N = int(input())
a = []
for i in range(N):
    a.append(i+1)
    if a[i] % 15 == 0:
        a[i] = 0
    elif a[i] % 5 == 0:
        a[i] = 0
    elif a[i] % 3 == 0:
        a[i] = 0

print(sum(a))

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())
A = list(range(1, N + 1))
ans = 0
for a in A:
    if (a % 3 == 0) or (a % 5 == 0):
        pass
    else:
        ans += A[a - 1]
print(ans)

Solution (Python):
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n = ni()

fa = []

for i in range(10**6+1):
  if i % 3 != 0 and i % 5 !=0:
    fa.append(i)

sum = 0
for i in fa:
  if i <= n:
    sum += i

print(sum)

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

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

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

print(sum(a))

Solution (Python):
from math import floor
def sum(x):
    return int(x *(x+1)/2)
N = int(input())

S = sum(N)

fizz = floor(N/3)
buzz = floor(N/5)
fizzbuzz = floor(N/15)
print(S - 3 * sum(fizz) - 5*sum(buzz) + 15 * sum(fizzbuzz))

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

S = int((N * (N+1)) / 2)

fizz = floor(N/3)
buzz = floor(N/5)
fizzbuzz = floor(N/15)
print(S - int(3 * fizz * (fizz+1)/2) -
          int(5*buzz*(buzz+1) /2) +
          int(15 * fizzbuzz * (fizzbuzz+1)/2))

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

A=[]
B=[]
C=[]
D=[]
for i in range(1,N+1):
    A.append(i)
for i in range(1,N//3+1):
    B.append(3*i)
for i in range(1,N//5+1):
    C.append(5*i)
for i in range(1,N//15+1):
    D.append(i*15)
    
print(sum(A)-(sum(B)+sum(C)-sum(D)))

Solution (Python):


def main():
    numbers = int(input())
    result = 0
    for number in range(1,numbers+1):
        if number % 3 != 0 and number % 5 != 0:
            result += number
    print(result)
    
if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
S =0
for i in range(1, 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())
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):
tmp = input().split()
N = int(tmp[0])

SN = 0
for n in range(N+1)[1:]:
    if not n % 3 == 0 and not n % 5 == 0:
        SN = SN + n

print (SN)

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):
def f(n):
    return n * (n + 1) // 2


def solve(string):
    n = int(string)
    return str(f(n) - 3 * f(n // 3) - 5 * f(n // 5) + 15 * f(n // 15))


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Solution (Python):
def solve(string):
    n = int(string)

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

    return str(f(n) - 3 * f(n // 3) - 5 * f(n // 5) + 15 * f(n // 15))


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Solution (Python):
def solve(string):
    return str(sum(i for i in range(int(string) + 1) if i % 3 > 0 and i % 5 > 0))


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

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

Solution (Python):


n = int(input())

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

n3 = n // 3
n5 = n // 5
n15 = n // 15

s3 = n3 * (n3 +1) // 2 * 3
s5 = n5 * (n5 +1) // 2 * 5
s15 = n15 * (n15 +1) // 2 * 15

print(total - s3 - s5 + s15)

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

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

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

not_fizzbuzz = []
for i in range(1, n+1):
    if 0 not in [i%3, i%5]:
        not_fizzbuzz.append(i)
print(sum(not_fizzbuzz))

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

Solution (Python):
import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(read())

ans = np.arange(N+1, dtype=np.int64)
ans[::3] = 0
ans[::5] = 0

print(ans.sum())

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

Solution (Python):
import numpy as np
N = int(input())
list_num = np.arange(1, N+1)

for i in list_num:
  if i % 3 == 0:
    list_num[i-1] = 0
  elif i % 5 == 0:
    list_num[i-1] = 0
  elif i % 15 == 0:
    list_num[i-1] = 0

print(list_num.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())
sum = 0
for i in range(1, N+1):
    if (i%3)*(i%5):
        sum += i

print(sum)

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

i = 1
ans = []

for i in range(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.append(i)

print(sum(ans))

Solution (Python):
n=int(input())
ans=0
for i in range(n):
  i+=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())
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())

ans = 0

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

print(ans)

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

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

print (count)

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

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

print(sum)

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

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

Solution (Python):
n = int(input())
def a(t):
    if n < t:
        return 0
    v = n // t * t
    return (t + v) * (v // t) // 2
print(a(1) - a(3) - a(5) + a(15))

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())
total = int(1/2 * N *  (N+1))
wa3 =  (N//3 * (N//3 + 1)) // 2 * 3
wa5 =  (N//5 * (N//5 + 1)) // 2 * 5
wa15 =  (N//15 * (N//15 + 1)) // 2 * 15
print(total - wa3 - wa5 + wa15)

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

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

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 not (i % 3 == 0 or i % 5 == 0 or i % 15 == 0):
        s += i
print(s)

Solution (Python):
import sys
import math
readline = sys.stdin.readline


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


if __name__ == '__main__':
    main()

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

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

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())
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())
A=[]

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

print(sum(A))

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

Solution (Python):
import numpy as np
N = int(input())
an = np.arange(1, N+1, 1)
for i in range(N):
    if an[i]%3==0:
        an[i] = 0
    elif an[i]%5==0:
        an[i] = 0
print(np.sum(an))