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):
a = int(input())
ans = 0

for i in range(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 or i % 5 == 0:
        pass
    else:
        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:
        pass
    else:
        res += i

print(res)

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

print(b)

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 or i%5==0:
        pass
    else:
        sum += i
print(sum)

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

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

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

Solution (Python):
import sys

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

N = int(read())

ans = 0

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

print(ans)

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

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

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

ans = 0

for i in range(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):
    pass
  else:
    ans+=i
    
print(ans)

Solution (Python):
import sys
N = int(input())
r3 = N//3
r5 = N//5
r15 = N//15
def sum(N):
    return int(1/2*N*(N+1))
S = sum(N) - 3*sum(r3) - 5*sum(r5) +15*sum(r15)
print(S)

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

sum = 0

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

print(sum)

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

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

print(FizzBuzz)

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

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

print(S)

Solution (Python):
n = range(int(input())+1)
N =list(n)
A =[]
B = []
for i in N[1:] :
  if i%3==0 and i%5==0 :
    A.append('fizzbuzz')
  elif i%3==0 :
    A.append('fizz')
  elif i%5==0 :
    A.append('buzz')
  else:
    B.append(i)
c=0
for j in B:
  c+=j
print(c)

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

print(ans)

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

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

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

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

print(sum(numbers))

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

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

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

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

total = 0

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

print(total)

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

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

print(ans)

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

Solution (Python):

I = int(input())
n = []
append = n.append

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

print(sum(n))

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

n = int(input())

ans = f(n,1) - f(n,3) - f(n,5) + f(n,15)

print(ans)

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

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

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

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

Solution (Python):

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

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

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

div = num // 15

count = 60 *  div ** 2

if num % 15 != 0:
    for i in range(div*15+1,num+1):
        if i%3!=0 and i%5!=0:
            count += i
print(count)

Solution (Python):
import numpy as np
A = int(input())
L = np.arange(A)+1
S = 0 
for i in range(A):
    if L[i]%3 != 0 and L[i]%5 != 0 :
        S  += L[i]
print(S)

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

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

print(sum)

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

Solution (Python):
n = int(input())
l = []
for i in range(n):
    l.append(i+1)
N = sum(l)

l3 = []
for i in range(n//3):
    l3.append(i+1)
s_3 = 3 * sum(l3)

l5 = []
for i in range(n//5):
    l5.append(i+1)
s_5 = 5 * sum(l5)

l15 = []
for i in range(n//15):
    l15.append(i+1)
s_15 = 15 * sum(l15)

ans = N - (s_3 + s_5 - s_15)
print(ans)

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

print(ans)

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

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

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

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

Solution (Python):
N = int(input())
nums = 0
start = 1
s = 0
while nums<N:
    if start%3 == 0 or start%5 == 0:
        pass
    else:
        s+=start
    nums+=1
    start+=1
print(s)

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

Solution (Python):
import numpy as np
a = np.arange(1, int(input())+1)
a[a%3 == 0] = 0
a[a%5 == 0] = 0
print(np.sum(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):
"""
    Author : thekushalghosh
    Team   : CodeDiggers
"""
import sys,math,cmath,time
start_time = time.time()

def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().split()))


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


ONLINE_JUDGE = __debug__
if not ONLINE_JUDGE:
    sys.stdin = open('input.txt','r')
    sys.stdout = open('output.txt','w')
else:
    input = sys.stdin.readline
t = 1
for tt in range(t):
    solve()
if not ONLINE_JUDGE:
    print("Time Elapsed:",time.time() - start_time,"seconds")
sys.stdout.close()

Solution (Python):
n=int(input())
sum=0
container=[]
for i in range(n):
    container.append(i+1)
j=0
while j<len(container):
    if container[j]%3==0:
        sum+=0
    elif container[j]%5==0:
        sum+=0
    elif container[j]%3==0 and container[j]%5==0:
        sum+=0
    else:
        sum+=container[j]
    j+=1
print(f"{sum}\n")

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

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

text = 0
count = 0


n = int(input())


while count < n:
    count += 1
    if (count % 3 != 0) and (count % 5 != 0):
        text = text + count


print(text)

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

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
r1 = sys.stdin.readline


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

    print(ans)


if __name__ == '__main__':
    solve()

Solution (Python):
N=int(input())
sum=N*(N+1)/2
for i in range(N+1):
    if i%3==0 or i%5==0:
        sum-=i
print(int(sum))

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


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

print(sum)

Solution (Python):
import sys
input=sys.stdin.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)

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

Solution (Python):

"""
Spyderエディタ

これは一時的なスクリプトファイルです
"""

n = int(input())

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

print(total)

Solution (Python):
N = int(input())
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:
        pass
    elif i % 5 == 0:
        pass
    elif i % 15 == 0:
        pass
    else:
     sum += i
 
print (sum)

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

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

print(sum)

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

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

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

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

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

print( out_sum )

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

if __name__ == '__main__':
    quest_b()

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):
import numpy as np
def main():
    n = int(input())
    arr = np.arange(n + 1)
    arr[3::3] = 0
    arr[5::5] = 0
    print(arr.sum())
if __name__ =='__main__':
    main()

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

	print(ans)

if __name__ == '__main__':
	main()

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

ans = 0
num3 = n // 3
if num3 >= 1:
    ans += (num3 * 3 + 3) * num3 // 2
num5 = n // 5
if num5 >= 1:
    ans += (num5 * 5 + 5) * num5 // 2
num15 = n // 15
if num15 >= 1:
    ans -= (num15 * 15 + 15) * num15 // 2
print((1 + n) * n // 2 - ans)

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

A = list(range(N+1))
for n in range(N+1):
    if n%3 == 0 or n%5 == 0:
        A[n] = 0

print(sum(A))

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

print(ryokun)

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

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

N = int(input())

count = 0

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

print(count)

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

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

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

print(B)

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

a = 0


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

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

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

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

b = 0

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

print(b)

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

res = 0;

for i in range(n + 1):
    res += i * (i % 5 != 0 and i % 3 != 0);

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

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

print(ans)

Solution (Python):
l=[]
for i in range(int(input())):
    n=i+1
    if n%15==0:
        a="FizzBuzz"
    elif n%3==0:
        a="Fizz"
    elif n%5==0:
        a="Buzz"
    else:
        a=n
        l.append(a)
    
print(sum(l))

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

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

Solution (Python):

def import_number():
    return int(input())


def import_int(n):
    return [int(input()) for i in range(n)]

N = import_number()
sum = (1 + N) * N / 2

tmp = int(N / 3)
sum -= (1 + tmp) * tmp / 2 * 3

tmp = int(N / 5)
sum -= (1 + tmp) * tmp / 2 * 5

tmp = int(N / 15)
sum += (1 + tmp) * tmp / 2 * 15

print(int(sum))

Solution (Python):
N=int(input())
S1=0
for n in range(1,N+1):
  S1+=n
S2=0
for n in range(0,N+1,3):
  S2+=n
S3=0
for n in range(0,N+1,5):
  S3+=n
S4=0
for n in range(0,N+1,15):
  S4+=n
  
print(S1-S2-S3+S4)

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

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

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):
import numpy as np
N = int(input())
a = np.arange(1,N+1)
b3 = a%3!= 0
b5 = a%5!= 0
b = b3 * b5
print(sum(a*b))

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

Solution (Python):
N=int(input())
Fizz=range(3,N+1,3)
Buzz=range(5,N+1,5)
FizzBuzz=range(15,N+1,15)
ans=sum(range(1,N+1))-sum(Fizz)-sum(Buzz)+sum(FizzBuzz)
print(ans)

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

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

Solution (Python):
import sys

N = int(sys.stdin.readline())

all_sum = N * (N+1) / 2
threes = (N//3) * (N//3 + 1) / 2
fives = (N//5) * (N//5 + 1) / 2
fifs = (N//15) * (N//15 + 1) / 2

ans = all_sum - threes*3 - fives*5 + fifs*15

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

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

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

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

print(res)

Solution (Python):
def main():
    n=int(input())
    s=n*(n+1)//2
    s-=(n//3)*(n//3+1)//2 * 3
    s-=(n//5)*(n//5+1)//2 * 5
    s+=(n//15)*(n//15+1)//2 * 15
    print(s)
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())
totalSum = (1+n)*n/2
fizz = ((3+(n//3)*3)/2)*(n//3)
buzz = ((5+(n//5)*5)/2)*(n//5)
fizzbuzz = ((15+(n//15)*15)/2)*(n//15)
print(int(totalSum-fizz-buzz+fizzbuzz))

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

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

print(int((n**2 + n)/2) - ans)

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

Solution (Python):
import sys
input = sys.stdin.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)

Solution (Python):
n = int(input())
N = list(range(1, n + 1))
a = list(range(0, n + 1, 3))
b = list(range(0, n + 1, 5))
b.extend(a)
ans = list(set(N) - set(b))
print(sum(ans))

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

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

ans = count - ans
print(ans)

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

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


print(total)

Solution (Python):
N=int(input())
S=1/2*N*(N+1)
FB=N//15
F=N//3
B=N//5

sum_FB=15*1/2*FB*(FB+1)
sum_F=3/2*F*(F+1)
sum_B=5/2*B*(B+1)
print(int(S-sum_B-sum_F+sum_FB))

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

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

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

while N>0:
  if (N%3==0) and (N%5)==0:
    i='FizzBuzz'
  elif (N%3==0):
    i='Fizz'
  elif (N%5==0):
    i='Buzz'
  else:
    i=N
    sum=sum+i
  N=N-1
  
print(sum)

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

Solution (Python):

from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect

def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


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


if __name__ == "__main__":
    solve()

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

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

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

print(sum)

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

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

print(ans)

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

Solution (Python):
n = int(input())
multiple_3_num = n // 3
multiple_5_num = n // 5
multiple_3_and_5_num = n // (3*5)
sum = 0
for i in range(1,n+1):
    sum += i
minus_num = 0
for i in range(1,multiple_3_num+1):
    minus_num += 3*i
for i in range(1,multiple_5_num+1):
    minus_num += 5*i
for i in range(1,multiple_3_and_5_num+1):
    minus_num -= 3*5*i
print(sum - minus_num)

Solution (Python):


N = int(input())

total = 0

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

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

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

Solution (Python):


n = int(input())
count = 0

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

    count += i

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

Solution (Python):
n = int(input())
s = n * (n + 1) // 2
m = n // 3
s3 = m * (m + 1) // 2 * 3
l = n // 5
s5 = l * (l + 1) // 2 * 5
k = n // 15
s15 = k * (k + 1) // 2 * 15
print(s - s3 - s5 + s15)

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

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

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

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

Solution (Python):


import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]

N = I()

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

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

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

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

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

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

f = int(N/3)
b = int(N/5)
fb = int(N/15)

ans = N*(N+1)/2 - 3*f*(f+1)/2 - 5*b*(b+1)/2 + 15*fb*(fb+1)/2

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

res = 0

for i in range(N+1):
    if i%3 and i%5:
        res += i

print(res)

Solution (Python):
import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
ans=n*(n+1)//2
x,y,z=n//3,n//5,n//15
ans-=3*(1+x)*x//2
ans-=5*(1+y)*y//2
ans+=15*(1+z)*z//2
print(ans)

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

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

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

for i in range(input_number):
    n = i + 1
    if not (n % 3 == 0 or n % 5 == 0):
        ans = ans + n
        
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
else:
    print(S)

Solution (Python):
a=input()

sum=0
for i in range(int(a)):
  if (i+1)%3!=0 and (i+1)%5!=0:
    sum=(i+1)+sum
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):
def f(N):
  rt = 0
  for i in range(N+1):
    if i % 3 != 0 and i % 5 != 0:
      rt += i
  return rt

N = int(input())
print(f(N))

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

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

sum15 = n15*(n15+1)//2 * 15
sum3 = n3*(n3+1)//2 * 3
sum5 = n5*(n5+1)//2 * 5

ans = N*(N+1)//2 + sum15 - sum3 - sum5
print(int(ans))

Solution (Python):


inputs: list = []
while True:
    try:
        inputs.append(input().strip('\n'))
    except EOFError:
        break



n = int(inputs[0])
total: int = 0

for i in range(1, n+1):

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

print(total)

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

a = 0

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

Solution (Python):

import numpy as np
n = int(input())
x = np.arange(n + 1, dtype=np.int64)
x[::3] = 0
x[::5] = 0
print(x.sum())

Solution (Python):
N = input()

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

print(ans)

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

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

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

ans = 0

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

print(ans)