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):
import sys
readline = sys.stdin.readline
 
 
N = int(readline())
 
ans = sum([i for i in range(1, N+1) if i % 3 != 0 and i % 5 != 0])
 
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(n):
    if 0 != (i + 1) % 3 and 0 != (i + 1) % 5:
        ans += (i + 1)
print(ans)

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

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

Solution (Python):
if __name__ == '__main__':
    from sys import stdin
    input = stdin.readline

    n = int(input())
    count = 0
    for i in range(1, n+1):
        if i%3!=0 and i%5!=0:
            count += i
    print(int(count))
"""
    n = input()
    for i in n:
        if i == '7':
            print('Yes')
            break
    else:
        print('No')
"""

Solution (Python):
def count_section_by_zero(data):
  count = 0
  flg = False
  start = 0
  for i, d in enumerate(data):
    if flg is False and d != 0:
      count += 1
      flg = True
      
    if d == 0:
      flg = False
  return count

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

def input_list_str():
  return list(map(str, input().split()))

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

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

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

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)
import math
import fractions
import collections
import itertools
from functools import reduce
main()

Solution (Python):
from sys import stdin
N = int(stdin.readline().rstrip())
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())
ans=0
for i in range(1,N+1):
    if i%3!=0 and i%5!=0:
        ans=ans+i
print(ans)

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


def fizzbuzz(n):
    if n % 15 == 0:
        return 'FizzBuzz'
    elif n % 3 == 0:
        return 'Fizz'
    elif n % 5 == 0:
        return 'Buzz'
    else:
        return n


for n in range(1, N + 1):
    if fizzbuzz(n) == n:
        ans += n
print(ans)

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

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

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

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

resolve()

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

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

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

Solution (Python):

if __name__ == '__main__':
    

    n = int(input())

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

    print(ans)

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

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

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

print(ans)

Solution (Python):
from collections import *
from heapq import *
from itertools import *
from fractions import gcd

from decimal import *
import copy
from bisect import *
import time
import sys
import math
input=lambda :sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**7)
N=int(input())


c=0
for a in range(1,N+1):
    if not (a%3==0 or a%5==0):
        c+=a
print(c)

Solution (Python):
from sys import stdin

def main():

    input = stdin.readline

    N = int(input())

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

    print(ans_sum)

if __name__ == "__main__":
    main()

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

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

Solution (Python):
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy




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

Solution (Python):


from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key


INF=1001001001
__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


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

def intinput():
    return int(input())

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

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x



if __name__ == '__main__':
    N = intinput()

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

def linput():
    return [int(x) for x in input().split()]

n = int(input())

a = 0

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

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

Solution (Python):
if __name__ == '__main__':
    n = int(input())
    ans = 0
    for i in range(n + 1):
        if i % 5 == 0 or i % 3 == 0:
            pass
        else:
            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())

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

Solution (Python):




n = int(input())


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

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



if __name__ == '__main__':
    main()

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

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

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

print(sum)

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







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

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

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

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

ret = 0

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

print(ret)

Solution (Python):

import sys


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

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

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

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

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

print(ans)

Solution (Python):
n = int(input())
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())
ans =0
for k in range(1,N+1):
    if k %3 ==0 or k %5 ==0:
        pass
    else:
        ans += k

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

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

Solution (Python):


def resolve():
    N = int(input())
    count =0
    for i in range(1,N+1):

        if i % 5 != 0 and i % 3 !=0:
            count += i
    print(count)
if __name__ == "__main__":
    resolve()

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

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

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

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

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

print(res)

Solution (Python):

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

Solution (Python):
n = int(input())
arr = [0 for i in range(n)]
for i in range(n):
    it = i+1
    if not ((it %3 == 0 and it%5==0) or it%3 == 0 or it%5 == 0):
        arr[i] = i+1

print(sum(arr))

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

print(b)

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

from decimal import *

























def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

inf = float('inf')
mod = 1000000007




def main():
	N = inputInt()

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

	print(ans)








class Graph(object):
    """
    隣接リストによる有向グラフ
    """

    def __init__(self):
        self.graph = defaultdict(list)

    def __len__(self):
        return len(self.graph)

    def add_edge(self, src, dst, weight=1):
        self.graph[src].append((dst, weight))

    def get_nodes(self):
        return self.graph.keys()


class Dijkstra(object):
    """
    ダイクストラ法（二分ヒープ）による最短経路探索
    計算量: O((E+V)logV)
    """

    def __init__(self, graph, start):
        self.g = graph.graph

        
        
        self.dist = defaultdict(lambda: float('inf'))
        self.dist[start] = 0

        
        self.prev = defaultdict(lambda: None)

        
        self.Q = []
        heappush(self.Q, (self.dist[start], start))

        while self.Q:
            
            dist_u, u = heappop(self.Q)
            if self.dist[u] < dist_u:
                continue
            for v, weight in self.g[u]:
                alt = dist_u + weight
                if self.dist[v] > alt:
                    self.dist[v] = alt
                    self.prev[v] = u
                    heappush(self.Q, (alt, v))

    def shortest_distance(self, goal):
        """
        startノードからgoalノードまでの最短距離
        """
        return self.dist[goal]

    def shortest_path(self, goal):
        """
        startノードからgoalノードまでの最短経路
        """
        path = []
        node = goal
        while node is not None:
            path.append(node)
            node = self.prev[node]
        return path[::-1]

def int_sqrt2(n):
    def f(prev):
        while True:
            m = (prev + n / prev) / 2
            if m >= prev:
                return prev
            prev = m

    return f(int(math.sqrt(n) * (1 + 1e-10)))



def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res


def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y



def H(n, r, mod=10**9+7):
	
	
    return combination(n+r-1, r, mod)

class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        
        
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

if __name__ == "__main__":
	main()

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


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




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

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

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

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

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(700000)

def s_in():
    return input()

def n_in():
    return int(input())

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

def print_l(l):
    print(' '.join(map(str, l)))

class Interval():
    def __init__(self, li):
        self.li = li
        self.n = len(li)
        self.sum_li = [li[0]]
        for i in range(1, self.n):
            self.sum_li.append(self.sum_li[i-1] + li[i])

    def sum(self, a, b=None):
        if b is None:
            return self.sum(0, a)

        res = self.sum_li[min(self.n-1, b-1)]
        if a > 0:
            res -= self.sum_li[a-1]
        return res

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

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

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

main()

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

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

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

Solution (Python):
data = [False] * 1000001

for i in range(1, 1000001):
  if i % 3 == 0 or i % 5 == 0:
    continue
  data[i] = True

n = int(input())
result = 0

for i in range(1, n + 1):
  if data[i]:
    result += i

print(result)

Solution (Python):
import math
import copy
import sys
import fractions


import decimal
import heapq
import collections
import itertools
import bisect



sys.setrecursionlimit(100001)







def getInputIntList():
    outputDataList = []
    inputData = input().split()
    outputDataList = [int(n) for n in inputData]

    return outputDataList


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList





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

print(ans)

Solution (Python):
N = int(input())
import numpy as np
L = np.array([i for i in range(N+1)])
print(np.sum(L[(L % 3 != 0 )&(L % 5 != 0)]))

Solution (Python):












mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

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

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

print(ans)

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

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

main()

Solution (Python):

import sys


def solve(N: int):
    def f(n):
        yield 0
        for i in range(1, N+1):
            if i % 3 == 0 or i % 5 == 0:
                continue
            yield i
    print(sum(f(N)))



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

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

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

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

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

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

print(ans)

Solution (Python):

import os
import sys
from io import BytesIO, IOBase


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




BUFSIZE = 8192


class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = "x" in file.mode or "r" not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b"\n") + (not b)
			ptr = self.buffer.tell()
			self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode("ascii"))
		self.read = lambda: self.buffer.read().decode("ascii")
		self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")



if __name__ == "__main__":
	main()

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

L = []
for i in range(1000002):
    if i % 3 != 0 and i % 5 != 0:
        L.append(i)
    else:
        L.append(0)

LL = [0]
for i in range(1, 1000001):
    LL.append(LL[i-1] + L[i])

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



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

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