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



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


if __name__ == '__main__':
    main()

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

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

print(sum)

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

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

N = int(input())

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

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

        ans += i

    print(ans)


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

    main(n)

Solution (Python):

import sys


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



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

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

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 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):
from collections import *
import sys
try: inp = raw_input
except: inp = input
def err(s):
    sys.stderr.write('{}\n'.format(s))

def ni():
    return int(inp())

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

N = ni()

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

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 math
import sys
input = sys.stdin.readline

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

print(tot)

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):
import heapq
from collections import defaultdict, deque
from math import ceil, factorial
from fractions import gcd
import sys

sys.setrecursionlimit(10 ** 7)
INF = float("inf")
MOD = 10 ** 9 + 7

si = lambda: input().strip()
ii = lambda: int(input())
mii = lambda: map(int, input().split())
lmii = lambda: list(map(int, input().split()))
smii = lambda: sorted(map(int, input().split()))


N = ii()

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

Solution (Python):


import sys
from itertools import accumulate

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N = INT()

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

for n in range(N+1):
    if n % 3 == 0 or n % 5 == 0:
        pass
    else:
        ans += n
print(ans)

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

ans = [0 if i % 3 == 0 or i % 5 == 0 else i for i in range(n+1)]
print(sum(ans))

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

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

print(tota)

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):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]





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

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

Solution (Python):
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

n = ni()

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

print(s(n) - s(n//3)*3 - s(n//5)*5 + s(n//15)*15)

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

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

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


main()

Solution (Python):


MOD = 10**9
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

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 math
import fractions
import collections
import itertools
N=int(input())
cnt=0
for i in range(N):
    if ((i+1)%5!=0)and((i+1)%3!=0):
        cnt=cnt+i+1
print(cnt)

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

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

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+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%15==0 or 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):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

import sys
import math
import string
import collections
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

sys.setrecursionlimit(10 ** 8)

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

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

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


if __name__ == '__main__':
    print(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 = input()
ans = 0
for num in xrange(1, n+1):
  if num%3 == 0 or num%5 == 0:
    ans += 0
  else:
    ans += num
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 == 0 and i % 5 == 0:
    pass 
  elif i % 3 == 0:
    pass 
  elif i % 5 == 0:
    pass 
  else:
    ans += i 

print(ans)

Solution (Python):
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def S(): return input()


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


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False



def main():
    N = I()
    ans = 0

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

    print(ans)


if __name__ == '__main__':
    main()

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):
from functools import reduce
print(reduce(lambda x, y:x+y, [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 = 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:
        continue
    ans += i
print(ans)

Solution (Python):
import sys
from collections import *
import heapq
import math
from math import gcd
import bisect
import copy
from itertools import permutations,accumulate,combinations,product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

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):
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

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

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

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

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

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


print(num_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):
def main():
    N = int( input())
    ans = 0
    for n in range(1,N+1):
        if n%3 != 0 and n%5 != 0:
            ans += n
    print(ans)
if __name__ == '__main__':
    main()

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

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

print(res)

Solution (Python):
n=int(input())
i=1
k=0
while i<n+1:
    if i%3!=0 and i%5!=0:
        k+=i
    i+=1
print(k)

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

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


import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read




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

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

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

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

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

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

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

Solution (Python):
n = int(input())
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:
        continue
    elif i % 3 == 0:
        continue
    elif i % 5 == 0:
        continue
    else:
        ans += i

print(ans)

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

if __name__=='__main__':
    main()

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

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):
b = int(input())
ans = 0
for i in range(1, b+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())

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

print(ans)

Solution (Python):
import sys

n = int(input())

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

print(sum)

Solution (Python):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]



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

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

    res += x

print(res)

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

print(res)

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

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

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

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

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

    total += v

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

MOD = 10 ** 9 + 7
INFI = 10**10

import math

import itertools
import heapq


import copy
from functools import lru_cache

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default




def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)


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



if __name__ == "__main__":

    main()

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

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

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

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

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

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

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

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

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

ret = 0

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

print(ret)

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

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

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

Solution (Python):
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

n = ni()

ans = 0

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

print(ans)

Solution (Python):
mod = 10**9 + 7
mod2 = 2**61 + 1
int1 = lambda x: int(x) - 1
from collections import deque
import heapq
import time
from bisect import bisect_left, insort_left, bisect_right
import sys
import random
import itertools



def input():
    return sys.stdin.readline().strip("\n").strip(" ")


_NUMINT_ALL = list(range(10))
_START_TIME = time.time()
INDEX_KETA = 10**12
INF = 9223372036854775807  

def main():
    ans = solve()

    if ans is True or ans is False:
        YesNo(ans)
    elif ans is None:
        return

    if isinstance(ans, tuple):
        split_print_space(ans)
    else:
        print(ans)


def solve():
    N = iip()

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






def kiriage_warizan(a, b):
    return -(-a // b)


def iip(listed=False):  
    d = input().rstrip("\n").split()
    try:
        ret = [int(i) for i in d]
    except:
        ret = [int(i) if i in _NUMINT_ALL else i for i in d]
        if len(ret) == 1 and listed is False:
            return ret[0]

    if len(ret) == 1 and not listed:
        return ret[0]
    return ret


def iipt(l, listed=True):  
    if isinstance(l, list):
        l = l[0]  
    assert isinstance(l, int)
    ret = []
    for i in range(l):
        ret.append(iip(listed=listed))
    return ret


def saidai_kouyakusuu(A):  
    l = len(A)
    while True:
        m = min(A)
        mx = max(A)
        if m == mx:
            return m

        for i in range(l):
            if A[i] % m == 0:
                A[i] = m
            else:
                A[i] %= m


def flatten(l):
    return list(itertools.chain.from_iterable(l))


def index_sorted(sorted_list, target):
    idx = bisect_left(sorted_list, target)
    if idx != len(sorted_list) and sorted_list[idx] == target:
        return idx
    else:
        return False


def time_debug_10percent():
    a = random.randint(0, 9)
    if a == 9:
        sys.exit()


def time_debug(t):
    time.sleep(_START_TIME + t - time.time())
    sys.exit()


def make_graph_edge_flat(N):  
    ret = []
    for i in range(N - 1):
        a, b, c = iip()
        a -= 1
        b -= 1
        ret[a].append((b, c))
        ret[b].append((a, c))
    return ret


def sort_tuples(l, index):  
    if isinstance(l, list):
        l.sort(key=lambda x:x[index])
        return l
    else:
        l = list(l)
        return sorted(l, key=lambda x:x[index])


def count_elements(l):  
    d = {}
    for i in l:
        if i in d:
            d[i] += 1
        else:
            d[i] = 1
    return d


def safeget(l, index, default="exception"):  
    if index >= len(l):  
        if default == "exception":
            raise Exception("".join(["safegetに不正な値 ", index, "が渡されました。配列の長さは", len(l), "です"]))
        else:
            return default
    elif index < 0:
        if default == "exception":
            raise Exception("".join(["safegetに不正な値 ", index, "が渡されました。負の値は許可されていません"]))
        else:
            return default
    else:
        return l[index]


def sortstr(s):  
    return "".join(sorted(s))


def iip_ord(startcode="a"):  
    if isinstance(startcode, str):
        startcode = ord(startcode)
    return [ord(i) - startcode for i in input()]


def YesNo(s):  
    if s:
        print("Yes")
    else:
        print("No")


def fprint(s):  
    if isinstance(s, int):
        print(s)
        return
    keta = max([len(str(i)) for i in itertools.chain.from_iterable(s)])
    print("--------")
    for i in s:
        print([str(j).rjust(keta) for j in i])
    print("--------")


def bitall(N):  
    ret = []
    for i in range(2**N):
        a = []
        for j in range(N):
            a.append(i % 2)
            i //= 2
        ret.append(a)
    return ret


def split_print_space(s):  
    print(" ".join([str(i) for i in s]))


def split_print_enter(s):  
    print("\n".join([str(i) for i in s]))


def soinsuu_bunkai(n):  
    ret = []
    for i in range(2, int(n**0.5) + 1):
        while n % i == 0:
            n //= i
            ret.append(i)
        if i > n:
            break
    if n != 1:
        ret.append(n)
    return ret


def conbination(n, r, mod, test=False):  
    if n <= 0:
        return 0
    if r == 0:
        return 1
    if r < 0:
        return 0
    if r == 1:
        return n
    ret = 1
    for i in range(n - r + 1, n + 1):
        ret *= i
        ret = ret % mod

    bunbo = 1
    for i in range(1, r + 1):
        bunbo *= i
        bunbo = bunbo % mod

    ret = (ret * inv(bunbo, mod)) % mod
    if test:
        
        pass
    return ret


def inv(n, mod):  
    return power(n, mod - 2)


def power(n, p, mod_=mod):  
    if p == 0:
        return 1
    if p % 2 == 0:
        return (power(n, p // 2, mod_)**2) % mod_
    if p % 2 == 1:
        return (n * power(n, p - 1, mod_)) % mod_


def nibutan_func(func, target, left, right, side="left", seido=1):  
    l = left
    r = right
    if seido == 1:
        x = (l + r) // 2
    else:
        x = (l + r) / 2
    while r - l > seido:
        
        if seido == 1:
            x = (l + r) // 2
        else:
            x = (l + r) / 2
        if func(x) == target:
            if side == "left":
                r = x
            else:
                l = x


        elif func(x) > target:
            r = x
        else:
            
            l = x

    
    if side == "left" and func(r) == target:
        return r
    elif side != "left" and func(l) == target:
        return l
    elif side == "left":
        return l
    else:
        return r


def nibutan_list(list_, target, side="left"):  
    if not isinstance(list_, list):
        list_ = list(list_)

    l = 0
    r = len(list_)
    x = (l + r) // 2
    while r - l > 1:
        x = (l + r) // 2
        if list_[x] == target:
            return x
        elif list_[x] > target:
            r = x
        else:
            l = x

    if side == "left" or list_[x] == target:
        return l
    else:
        return r


class UfTree():
    def __init__(self, maxnum):
        self.parent = list(range(maxnum))
        self._size = [1] * maxnum
        self.rank = [0] * maxnum

    def size(self, a):
        return self._size[self.root(a)]

    def root(self, a):
        rank = 0
        cur = a
        while True:
            if self.parent[cur] == cur:
                
                
                return cur
            else:
                self.parent[cur] = self.parent[self.parent[cur]]
                cur = self.parent[cur]
                rank += 1

    def unite(self, a, b):
        ra = self.root(a)
        rb = self.root(b)
        if ra == rb:
            return self

        self._size[ra] += self._size[rb]
        self.parent[rb] = ra
        return self


if __name__ == "__main__":
    main()