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())
count=0
for i in range(N+1):
  if i%3==0 and i%5 == 0:
    a=1
  elif i%3==0:
    a=1
  elif i%5==0:
    a=1
  else:
    count+=i
print(count)

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

Solution (Python):
a=[]
for i in range(1,int(input())+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())
strN = str(N)

dummy = 0
sumval = 0
for count in range(1,N+1):
    if count % 3 == 0 or count % 5 == 0:
        dummy = 0
    else:
        sumval = sumval + count
print(sumval)

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

Solution (Python):


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

print(sum)

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

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

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):
a=int(input())
b=((a//3)*(3+(3*(a//3))))*(1/2)
c=((a//5)*(5+(5*(a//5))))*(1/2)
d=((a//15)*(15+(15*(a//15))))*(1/2)
e=(a*(1+a)*(1/2))-(b+c-d)
print(int(e))

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

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

print(num)

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

for i in range(N):
  num = i + 1;
  if num % 3 != 0 and num % 5 !=0:
    sum += num;
  else:
    pass;

print(sum)

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

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

Solution (Python):

import sys
N = int(sys.stdin.readline())
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())
x = n // 3
y = n // 5
z = n // 15
x = x * (x + 1) // 2
y = y * (y + 1) // 2
z = z * (z + 1) // 2
sum = n * (n + 1) // 2
print(sum - x * 3 - y * 5 + z * 15)

Solution (Python):
class atcorder:
    N=int(input())
    
    ans=0
    for i in range(N):
        n=i+1
        if n%3==0 and n%5==0:
            pass 
        elif n%3==0:
            pass 
        elif n%5==0:
            pass 
        else:
            ans+=n
    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):
a = int(input())

totalsum = 0

for i in range(1, a+1):
  if (i%3 == 0 and i%5 == 0) or i%3==0 or i%5==0:
    i += 1
  else:
    totalsum += i

print(totalsum)

Solution (Python):
import sys

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

Solution (Python):
from sys import stdin

def main():
  N = int(stdin.readline())
  print(sum([n for n in range(1, N+1) if (n%3 != 0) and (n%5 != 0)]))
  
if __name__ == '__main__':
  main()

Solution (Python):
import numpy as np

a = int(input())
list = []

for i in range(a):
    if (i + 1) % 3 == 0 or (i + 1) % 5 == 0:
        list.append(0)
    else:
        list.append(i + 1)

np_list = np.array(list)
print(np_list.sum())

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

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

l = []
for i in range(1,n+1):
    if i % 3 == 0: pass    
    elif i % 5 == 0: pass 
    else: l.append(i)

ans = sum(l)
print(ans)

Solution (Python):



def main():
	num = int(input())
	sum = 0
	for i in range(num):
		if not (i+1) % 3 == 0 and not (i+1) % 5 == 0:
			sum += (i+1)
	
	print (sum)

if __name__ == '__main__':
	main()

Solution (Python):

n = int(input())+1
a = int(0)
for i in range(1,n):
	if i % 3 != 0 and i % 5 != 0:
		a = a + i
print("{}".format(a))

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

print(ans)

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

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

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

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

Solution (Python):
a = int(input());
b = [];
c = 0;
for i in range(a+1):
    if i%3==0 and i%5==0:
        b.append("FizzBuzz");
    elif i%3==0 and i%5!=0:
        b.append("Fizz");
    elif i%3!=0 and i%5==0:
        b.append("Buzz");
    else:
        c = c+i;
print(c);

Solution (Python):
n = int(input())
l = []

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

print(sum(l))

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

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

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

Solution (Python):
ans=int(0)
for i in range(int(input())+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 or i%5 == 0:
        count = count + 0
    else:
        count = count + i

print(count)

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

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

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

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

ans_sum = 0

for now_num in range(num+1):
    if now_num % 3 != 0 and now_num % 5 != 0:
        ans_sum = ans_sum + now_num
    
print(ans_sum)

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

print(s)

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

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

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

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

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

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

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

Solution (Python):
def main():
    n: longlong
    n = int(input())

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


if __name__ == "__main__":
    main()

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

N = int(input())

ans = 0

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

print(ans)

Solution (Python):
n = int(input())
p = n//15
c = 60 * p ** 2
q = n - p * 15
for i in range(q):
  d = i + p * 15 + 1 
  if d % 3 != 0 and d % 5 != 0:
    c += d
print(c)

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

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

Solution (Python):
N = int(input())
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):
def sum(x):
  return x*(x+1)/2

n=int(input())
total =sum(n)
three=int(n/3)
five=int(n/5)
fifteen=int(n/15)
three=sum(three)*3
five=sum(five)*5
fifteen=sum(fifteen)*15
print(int(total-three-five+fifteen))

Solution (Python):





N = int(input())
sum_fizzbuzz = 0
for i in range(1, N + 1):
    fz = ''
    if i % 3 == 0:
        fz = fz + 'Fizz'
    if i % 5 == 0:
        fz = fz + 'Buzz'
    if fz == '':
        sum_fizzbuzz = sum_fizzbuzz + i

print(sum_fizzbuzz)

Solution (Python):
n = int(input())
s = list(map(lambda m: 1/2*m*(m+1), (n, n//3, n//5, n//15)))
print(int(s[0] - s[1]*3 - s[2]*5 + s[3]*15))

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

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

sum = 0
l = [1] * N

for i in range(N):
    if (i+1)%15 == 0:
        l[i] = 0
    elif (i+1)%3 == 0:
        l[i] = 0
    elif (i+1)%5 == 0:
        l[i] = 0

for i in range(N):
    if l[i] == 1:
        sum += i+1

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

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

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

Solution (Python):
input = input()
a = []
i = 1
while(i <= int(input)):
    if i%3 == 0 or i%5 == 0:
        pass
    else:
        a.append(i)
    i += 1
res = 0
for j in a:
  res = res + j
print(res)

Solution (Python):
a=int(input())
l=[]
for i in range(1,a+1):
    l.append(i)
k=[]
for i in range(1,a+1):
    if not i % 5 or not i % 3:
        k.append(i)
s=sum(k)
k=sum(l)
print(k-s)

Solution (Python):


import sys
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)
sys.setrecursionlimit(10**7)
mod = 1000000007


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def main():
    n = int(sys.stdin.readline())
    s = (n * (n + 1)) // 2
    
    three = (n // 3)
    s -= 3*((three*(three+1))//2)
    five = (n // 5)
    s -= 5 * ((five * (five + 1)) // 2)
    fif = (n // 15)
    s += 15*((fif*(fif+1))//2)
    print(s)


if __name__ == "__main__":
    try:
        IOE()
    except:
        pass
    main()

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

Solution (Python):
a=int(input())
l=[]
for i in range(1,a+1):
    l.append(i)
k=[]
for i in range(1,a+1):
    if not i % 5 or not i % 3:
        k.append(i)
s=sum(k)
k=sum(l)
print(k-s)

Solution (Python):
N=int(input())
L=list(range(1,N+1))
L3=list(range(3,N+1,3))
L5=list(range(5,N+1,5))
L15=list(range(15,N+1,15))
ans=sum(L)-sum(L3)-sum(L5)+sum(L15)
print(ans)

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

for i in range(n+1):
    if ((int(i)%3)!=0) & ((int(i)%5)!=0):
        s += int(i)


print(int(s))

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 = [i for i in range(1, N + 1)]

s = 0
for i in l:
    if i % 3 != 0 and i % 5 != 0:
        s += i
print(s)

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

Solution (Python):
N = int(input())
A = 0
for i in range(1,N+1):
    if i%3 == 0 and i%3 == 5:
        i = "FizzBuzz"
    elif i%3 == 0:
        i = "Fizz"
    elif i%5 == 0:
        i = "Buzz"
    else:
        A += i
print(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())
l = [i for i in range(1, N + 1)]
s = []
for i in l:
    if i % 3 != 0 and i % 5 != 0:
        s.append(i)
print(sum(s))

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

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

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

Solution (Python):
N = int(input())
counts=0
for i in range(N):
    i+=1
    FizzBuzz=i%15
    Fizz=i%3
    Buzz=i%5
    if FizzBuzz ==0 or Fizz==0 or Buzz==0:
        continue
    else:
        counts+=i
print(counts)

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

Solution (Python):
N = int(input())
A = 0
for i in range(1,N+1):
    if i%3 == 0 and i%3 == 5:
        i = "FizzBuzz"
    elif i%3 == 0:
        i = "Fizz"
    elif i%5 == 0:
        i = "Buzz"
    else:
        A += i
print(A)

Solution (Python):
N=int(input())
s=0
for a in range(N+1):
    if a%3==0:
        continue
    elif a%5==0:
        continue
    else:
        s+=a
print(s)

Solution (Python):
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
from random import choice,randint
inp=sys.stdin.readline
out=sys.stdout.write
flsh=sys.stdout.flush
 
sys.setrecursionlimit(10**9)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
 
def MI(): return map(int, inp().strip().split())
def LI(): return list(map(int, inp().strip().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]
def LI_(): return [int(x)-1 for x in inp().strip().split()]
def LF(): return [float(x) for x in inp().strip().split()]
def LS(): return inp().strip().split()
def I(): return int(inp().strip())
def F(): return float(inp().strip())
def S(): return inp().strip()
def pf(s): return out(s+'\n')
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)

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

if __name__ == "__main__":
    main()

Solution (Python):
import bisect,sys
import math
from collections import deque

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))

INF = 1 << 29

DIV = (10**9) + 7

def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def CONV_TBL(max, mod=DIV):
    fac, finv, inv = [0]*max, [0]*max, [0]*max
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, max):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod % i] * (mod//i) % mod
        finv[i] = finv[i-1]*inv[i] % mod

    class CONV:
        def __init__(self):
            self.fac =fac
            self.finv = finv
            pass

        def ncr(self, n, k):
            if(n < k):
                return 0
            if(n < 0 or k < 0):
                return 0
            return fac[n]*(finv[k]*finv[n-k] % DIV) % DIV
        
    return CONV()



sys.setrecursionlimit(200005)


def main():
    N = iRaw()
    ans = 0
    for n in range(1,N+1):
        if n%3!=0 and n%5!=0:
            ans+=n
    return ans
    
if __name__ == "__main__":
    print(main())

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

print(cal)

Solution (Python):



def main():
    import sys
    input = sys.stdin.readline

    n = int(input())
    ans = 0

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

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
l=list(range(1,N+1))

l=[i for i in l if not ((i%3==0 and i%5==0) or i%3==0 or i%5==0)]

print(sum(l))

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

Solution (Python):
def main():
  N=int(input())
  cur=0
  for i in range(1,N+1):
    if i%3!=0 and i%5!=0:
      cur+=i
  print(cur)
  return
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):
n=int(input())
print(sum([i for i in range(1,n+1) if not (i%3==0 or i%5==0)]))

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

ans = 0
for i in range(N+1):
    if i % 15 in (1, 2, 4, 7, 8, 11, 13, 14):
        ans += i

print(ans)

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

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

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

Solution (Python):
N = int(input())
s = lambda n: n * (n + 1) // 2

ans = s(N) - s(N // 3) * 3 - s(N // 5) * 5 + s(N // 15) * 15

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())
print(((N*(N+1))-(N//3*(N//3+1)*3)-(N//5*(N//5+1)*5)+(N//15*(N//15+1)*15))//2)

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

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

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

Solution (Python):
import numpy as np
N=list(range(1,int(input())+1))
a=np.asarray(N,dtype='int64')
b=a%3
c=a%5
d=np.array([a,b,c])
d=np.delete(d, np.where(d==0)[1], axis=1)
print(np.sum(d[0]))

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

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

Solution (Python):

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

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

Solution (Python):
import numpy as np
n = int(input())
a = np.arange(n+1)
a[::3] = 0
a[::5] = 0
print(np.sum(a))

Solution (Python):

N = int(input())

ary2 = []

for x in list(range(1, N + 1, 1)):
    if x % 3 != 0 and x % 5 != 0:
        ary2.append(x)

print(sum(ary2))

Solution (Python):

N = int(input())

ary = list(range(1, N + 1, 1))
ary2 = []

for x in ary:
    if x % 3 != 0 and x % 5 != 0:
        ary2.append(x)

print(sum(ary2))

Solution (Python):
N = input()
turn = 1
sum_AC = 0
while int(N)>=turn:
  if turn % 15 == 0:
    turn += 1
  elif turn % 3 == 0:
    turn += 1 
  elif turn % 5 ==0:
    turn += 1
  else:
    sum_AC += turn
    turn += 1

print(sum_AC)

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

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

print(b)

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

Solution (Python):

s = int(input())
ans =0

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

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

print(sum)

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

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

    c+=i
print(c)

Solution (Python):

N = int(input())
terms = list(range(1,N+1))
terms_fb = []
for n in terms:
    if n%3 ==0 and n%5 ==0:
        terms_fb.append('FizzBuzz')
    elif n%3 ==0:
        terms_fb.append('Fizz')
    elif n%5 ==0:
        terms_fb.append('Buss')
    else:
        terms_fb.append(n)
a =0
for c in terms_fb:
    if isinstance(c, int):
        a += c
print(a)

Solution (Python):
from sys import stdin

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

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

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

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 sys import stdin

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

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 = [i for i in range(0, N+1)]

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

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

for i in range(0, N+1, 15):
    ans[i] = 0

print(sum(ans))

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

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

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

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

Solution (Python):


def qsum(n, q):
    t = n // q
    return t * (q + q * t) // 2

n = int(input())

s = n * (n + 1) // 2
s -= qsum(n, 3)
s -= qsum(n, 5)
s += qsum(n, 15)

print(s)

Solution (Python):
N = input('')
N=int(N)
fizzbuzz = list(range (1, N+1))
fizzbuzz = fizzbuzz 
sumnum = 0

for i in range (len(fizzbuzz)):
    if fizzbuzz[i]%3==0  and fizzbuzz[i]%5==0:
        fizzbuzz[i] = "FizzBuzz"
    elif fizzbuzz[i]%3==0:
        fizzbuzz[i] = "Fizz"
    elif fizzbuzz[i]%5==0:
        fizzbuzz[i] = "Buzz"
    else:
        sumnum +=  fizzbuzz[i]

print(sumnum)

Solution (Python):
fz = []
for i in range(1,10**6+2):
    if i % 3 == 0 or i % 5 == 0 or i % 15 == 0:
        fz.append(0)
    else:
        fz.append(i)
n = int(input())
print(sum(fz[:n]))

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

Solution (Python):
def CheckFizBuzz(i):
    if(i %3 == 0) or ( i % 5 == 0):
        return 0
    return i


n = int(input())
ans = 0

for i in range(n):
    ans += CheckFizBuzz(i+1)

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())
all = int((1+n)*n/2)
count1 = int(n/3)
count2 = int(n/5)
count3 = int(n/15)
print(int(all-(1+count1)*count1/2*3-(1+count2)*count2/2*5+(1+count3)*count3/2*15))

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

print(sum(lists))

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

ans = 0

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

print(ans)

Solution (Python):
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())
a = n // 3
b = n // 5
c = n // 15
print(n * (n + 1) // 2 - a * (a + 1) // 2 * 3 - b * (b + 1) // 2 * 5 + c * (c + 1) // 2 * 15)

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=[]
sum=0
for i in range(n):
    if (i+1)%3==0 and (i+1)%5==0:
        a.append('FizzBuzz')
    elif (i+1)%3==0:
        a.append('Fizz')
    elif (i+1)%5==0:
        a.append('Buzz')
    else:
        a.append(i+1)
        sum=sum+(i+1)

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


from sys import stdin, stderr

def sum1toN(N):
   return N*(N+1)/2

def main():
   N = int(stdin.readline())
   res = sum1toN(N)
   res -= sum1toN(N/3)*3
   res -= sum1toN(N/5)*5
   res += sum1toN(N/15)*15
   print(res)

   return 0

if __name__ == '__main__': main()

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

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

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

print(s)

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

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

print(ans)

Solution (Python):
N=int(input())
total=[]

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

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

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

print(int((1+a)*a/2-(a//3)*(3+a//3*3)/2-(a//5)*(5+a//5*5)/2+(a//15)*(15+a//15*15)/2))

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

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

Solution (Python):
from sys import stdin, stdout
rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()

def main():
	n = int(rl())
	ans = 0
	for i in range(1, n + 1):
		if i % 3 != 0 and i % 5 != 0:
			ans += i 
	stdout.write(str(ans));stdout.write("\n")
	stdout.close()

if __name__ == "__main__":
	main()

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

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

print(sm)

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

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

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

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

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

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

Solution (Python):

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

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

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

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

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

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

Solution (Python):
from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

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

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

def inpl_str(): return list(sys.stdin.readline().split())

n = inp()
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 = []
num = 0
for i in range(1,N+1):
    if i%15==0 :
        a.append('FizzBuzz')
    elif i%3==0 :
        a.append('Fizz')
    elif i%5==0 :
        a.append('Buzz')
    else:
        a.append(i)
        num += i

print(num)

Solution (Python):
def main():
    N = int(input())
    X = N // 15
    Y = N % 15
    m = [0, 1, 2, 0, 4, 0, 0, 7, 8, 0, 0, 11, 0, 13, 14]
    cnt = [0, 1, 2, 2, 3, 3, 3, 4, 5, 5, 5, 6, 6, 7, 8]
    csm = [0, 1, 3, 3, 7, 7, 7, 14, 22, 22, 22, 33, 33, 46, 60]
    ans = X * 60 + (X-1) * X // 2 * 120 + cnt[Y] * (15*X) + csm[Y]
    print(ans)


if __name__ == "__main__":
    main()

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