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

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

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

print(ans)

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

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

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

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

print(ans)

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

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

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

ls = []

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

print(sum(ls))

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

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

cnt = 0

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

print(cnt)

Solution (Python):



n = int(input())

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

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

Solution (Python):


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

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

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

sm = 0

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

Solution (Python):
input = raw_input

n = int(input())
q3 = n // 3
q5 = n // 5
q15 = n // 15

out = n * (n+1) // 2 - ( 3 * q3 * (q3+1) // 2 + 5 * q5 * (q5+1) // 2) + 15 * q15*(q15+1) // 2
print(out)

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

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

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

ans = 0
for i in range(1, a+1):
    if not(i % 3 == 0 or 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:
        continue
    elif i % 3 == 0:
        continue
    elif i % 5 == 0:
        continue
    else:
        ans += i

print(ans)

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

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):
print(sum([k for k in range(int(input()) + 1) if k % 3 and k % 5]))

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

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

print(L)

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):
from sys import stdin, stdout
def main():
    n=int(stdin.readline())
    sm = []
    for i in range(1, n+1):
        if i % 3 == 0 or i % 5 == 0:
            continue
        sm.append(i)
    print(sum(sm))
main()

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

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

print(res)

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):
a = int(input())
ans = sum(filter(lambda i: i % 3 != 0 and i % 5 != 0, range(1, a+1)))
print(ans)

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

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

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

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):
if __name__ == "__main__":
    N = int(input())

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

    print(result)

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

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

p = n // 3 
q = n // 5 
r = n // 15 

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

print(hoge(n) - 3 * hoge(p) - 5 * hoge(q) + 15 * hoge(r))

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

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

a=[]

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

Solution (Python):
n=int(input())
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:
        pass
    elif i%3 == 0:
        pass
    elif i%5 == 0:
        pass
    else:
        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())
ans = []
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.append(i)
print(sum(ans))

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

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

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

print(ans)

Solution (Python):
import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
cnt=0

while N>0:
	if N%3==0 or N%5==0:
		N=N-1
	else:
		cnt+=N
		N=N-1
		
print(cnt)

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

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

a = 0

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

print(a)

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 not(i % 3 == 0 or 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:
        sum = sum
    else:
        sum = sum + i

print(sum)

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

Solution (Python):
import math
import sys

n=int(input())



sum=0

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

print(sum)

Solution (Python):
import collections, math

local = False
if local:
    file = open("input.txt", "r")

def inp():
    if local:
        return file.readline().rstrip()
    else:
        return input().rstrip()

def ints():
    return [int(_) for _ in inp().split()]


N = int(inp())

summed = 0
for i in range(1, N+1):
    three = i%3==0
    five = i%5==0

    if not five and not three:
        summed+=i

print(summed)

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

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

ans = 0

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

print(ans)

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

Solution (Python):
def calc(N):
    x = 0
    for i in range(1, N + 1):
        if i % 3 != 0 and i % 5 != 0:
            x += i
    return x


N = int(input())
print(calc(N))

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

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


print(count)

Solution (Python):


import sys

DEBUG = False

def read(t):
    return t(sys.stdin.readline().rstrip())


def read_list(t, sep = " "):
    return [t(s) for s in sys.stdin.readline().rstrip().split(sep)]


def dprint(*args, **kwargs):
    if DEBUG:
        print(*args, **kwargs)
    return


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



if __name__ == "__main__":
    main()

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

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

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

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

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

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)


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










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
""" n! mod m 階乗
mod = 1e9 + 7
N = 10000000
fac = [0] * N
def ini():
  fac[0] = 1 % mod
  for i in range(1,N):
    fac[i] = fac[i-1] * i % mod"""
 
"""mod = 1e9+7
N = 10000000
pw = [0] * N
def ini(c):
  pw[0] = 1 % mod
  for i in range(1,N):
    pw[i] = pw[i-1] * c % mod"""
 
"""
def YEILD():
  yield 'one'
  yield 'two'
  yield 'three'
generator = YEILD()
print(next(generator))
print(next(generator))
print(next(generator))
"""
"""def gcd_(a,b):
  if b == 0:
    return a
  return gcd_(a,a % b) 
"""def extgcd(a,b,x,y):
  d = a
  if b!=0:
    d = extgcd(b,a%b,y,x)
    y -= (a//b) * x
    print(x,y)
  else:
    x = 1
    y = 0
  return d"""
 

"""def gcd(a,b):
  if b == 0:
    return a
  return gcd(b, a % b)
def lcm(a,b):
  g = gcd(a,b)
  return (a * b) // g"""
 

"""import bisect 
print(A,bisect.bisect_left(A,4))
print(C,n - bisect.bisect_right(C,4))
print(sum(bisect.bisect_left(A,b) * (n-bisect.bisect_right(C,b)) for b in B))"""
 

"""import math
pi_ = math.pi"""
 

"""def Erato(n):
    prime = []
    is_prime = [True] * (n+1)
    p = 0
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2,n+1):
      if is_prime[i] == True:
        prime.append(i)
        p += 1
        for j in range(2 * i,n+1,i):
          is_prime[j] = False
    return p"""
 
def readInts():
  return list(map(int,input().split()))
mod = 10**9 + 7
def main():
  n = int(input())
  Fizz = [0] * n
  for i in range(1,n+1):
    if i % 15 == 0:
      pass
    elif i % 3 == 0:
      pass
    elif i % 5 == 0:
      pass
    else:
      Fizz[i-1] = i
  print(sum(Fizz))
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())
c = 0
for i in range(N):
    if (i+1)%3 == 0 or (i+1)%5 == 0:
        continue
    c+=i+1
print(c)

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

print(sum(a))

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

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

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

Solution (Python):
import collections
import math
import operator as op
from functools import reduce
from collections import Counter
import numpy as np
import math
import bisect
import heapq


MOD = 1000000007


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd(a, b)


def get_inputs(cast_func=None):
    if cast_func is None:
        return input().split()
    else:
        return list(map(cast_func, input().split()))


def get_input(cast_func=None):
    if cast_func is None:
        return input()
    else:
        return cast_func(input())


def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


def main():
    N = get_input(int)
    
    
    
    


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

    print(ans)




if __name__ == '__main__':
    main()

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

Solution (Python):

N = int(input())

ans = 0

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


print(ans)

Solution (Python):

import numpy as np
N = int(input())

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

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

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

a = list(range(1, N+1))

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

print(ans)

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

Solution (Python):
N=int(input())
a=0
for i in range(1,N+1):
    if i%3==0:
        pass
    elif i%5==0:
        pass
    else:
        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())
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())
S = 0
for i in range(N):
    if (((i+1)%3 != 0) & ((i+1)%5 != 0)):
        S = 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):
def b (n) :
    def find_sum(y) :
        return ((y+1)*y)//2

    total = find_sum(n)
    total -= find_sum(n//3)*3
    total -= find_sum(n//5)*5
    total += find_sum(n//15)*15

    return total

if __name__ == "__main__" :
    n = int(input())
    print(b(n))

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 or i%5==0:
        pass
    else:
        ans += i

print(ans)

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

print(sum)

Solution (Python):
N = int(input())
total= ((N+1)*N)//2
F = 0
for i in range(1,N):
    if i*15 > N:break
    else:F += i*15

for i in range(1,N):
    if i*5 > N:break
    elif i*5%15==0:continue
    else:F += i*5

for i in range(1,N):
    if i*3 > N:break
    elif i*3%15 == 0:continue
    else:F += i*3
print(total-F)

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

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

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

print(ans)

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

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

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

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

print(ans)

Solution (Python):
from collections import defaultdict, deque
import sys
import heapq
import bisect
import math
import itertools
import string
import queue
import copy
import time

from fractions import gcd

sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())
 
def inp_list(): return list(map(int, sys.stdin.readline().split()))

def lcm(x, y): return (x * y) // gcd(x, y)

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

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

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

Solution (Python):
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
from fractions import gcd
from copy import deepcopy
import math
import queue
import numpy as np

Mod = 1000000007
import sys
sys.setrecursionlimit(100000) 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

def main(): 
    a = []
    n = int(input())
    for i in range(n+1):
        if i % 3 == 0 or i % 5 == 0:
            a.append(0)
        else:
            a.append(i)
    print(sum(a))
if __name__ == "__main__":
    main()

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

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

if __name__ == "__main__":
    main()

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

def resolve():
    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__':
    resolve()

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(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):
from collections import defaultdict
from collections import deque
from string import ascii_uppercase
import sys, bisect, math, heapq

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

N = read_int()[0]

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

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

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

Solution (Python):
import sys
import math
import collections
from collections import deque
import heapq
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):
x = int(input())
c = 0
for i in range(x):
    k = i+1
    if k % 3 != 0 and k % 5 != 0:
        c += k

print(c)

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):
if __name__ == '__main__':
	 N = int(input())
	 
	 ans = 0

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

	 print(ans)

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

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

print(sum(num))

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

S = 0

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

    S += i

print(S)

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

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

print(ret)

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

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

count = 0

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

print(count)

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

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

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

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

ans = sum(a)
print(ans)

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

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

ret = list()
for ai in range(n):
    num = ai + 1
    if num % 15 == 0:
        pass
    elif num % 5 == 0:
        pass
    elif num % 3 == 0:
        pass
    else:
        ret.append(num)

print(sum(ret))

Solution (Python):
import sys
from io import StringIO
import unittest

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

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """15"""
        output = """60"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """1000000"""
        output = """266666333332"""
        self.assertIO(input, output)

if __name__ == "__main__":
    
    resolve()

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

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

s=0

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

print(s)

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

N = int(input())

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

print(answer)

Solution (Python):
import sys
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N = int(read())
ans = 0

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

print(ans)

Solution (Python):


n = int(input())

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

print (c)

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 or i % 5 == 0:
        continue
    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):


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

    res = []

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


if __name__ == '__main__':
    main()

Solution (Python):
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

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

Solution (Python):
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree
from scipy.sparse import csr_matrix, coo_matrix, lil_matrix
import numpy as np
from collections import deque, Counter, defaultdict
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush, heapify
from bisect import bisect_left, bisect_right, bisect
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
from functools import reduce
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7
def lcm_base(a, b):
    return (a * b) // gcd(a, b)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def main():
  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)
  
  
if __name__ == '__main__':
  main()

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

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

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)