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.



Sample input:
15


Sample output:
60

Submission status: Wrong Answer

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

print(nsum)

Submission status: Wrong Answer

Solution code:
a=0

for i in range(int(input())):
	if i%15==0:
		continue
	elif i%3==0:
		continue
	elif i%5==0:
		continue
	else:
		a+=i
print(a)

Submission status: Wrong Answer

Solution code:
N = list(map(int, input().split()))

print(sum([n for n in N if n % 3 != 0 and n % 5 != 0]))

Submission status: Wrong Answer

Solution code:
a=int(input())
ans=0
for i in range(a):
  if not i%3==0 and not i%5==0:
    ans+=i
print(ans)

Submission status: Wrong Answer

Solution code:
a=int(input())
ans=0
for i in range(a):
  if not i%3==0 and not i%5==0:
    ans+=i

Submission status: Wrong Answer

Solution code:
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())
m = 100000
ans = 0
cnt3 = 0
cnt5 = 0
for i in range(n):
  if i%3 == 0:
    cnt3 += i//3
  elif i%5 == 0:
    cnt5 += i//5

if n%2 == 0:
  S = (n+1)*n//2
else:
  S = (n+1)*n//2 + (n+1)//2

print(S - cnt3*3 - cnt5*5)

Submission status: Wrong Answer

Solution code:
n = int(input())
m = 100000
ans = 0
cnt = 0
for i in range(n):
  if i%3 == 0 or i%5 == 0:
    pass
  else:
    ans += i
    if ans >= m:
      ans -= m
      cnt += 1

print(ans + cnt*m)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = [0]
for i in range(n):
  if i%3 == 0 or i%5 == 0:
    pass
  else:
    ans.append(i)

print(sum(ans))

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
array = [ a for a in range(1,N) if (a % 3 != 0 and a % 5 != 0) ]

if not ( 1 <= N <= 10**6 ): sys.exit()
print(sum(array))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())
res = 0
for i in range(a):
  if i % 3 ==0 or i % 5 ==0:
    pass
  else:
    res += i
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
output = 0
for i in range(n):
    if i % 3 == 0 or i % 5 == 0:
        pass
    elif i % 3 == 0 and i % 5 == 0:
        pass
    else:
        output += i
print(output)

Submission status: Wrong Answer

Solution code:
n = int(input())
output = 0
for i in range(n):
    if i % 3 == 0 or i % 5 == 0:
        pass
    else:
        output += i
print(output)

Submission status: Wrong Answer

Solution code:
n = int(input())
m = 0
a = n // 3
b = n // 5
c = n // 15
for i in range(n):
    m = m+i
for j in range(a):
    m = m-(3*j)
for k in range(b):
    m = m-(5*k)
for l in range(c):
    m = m+(15*l)
print(m)

Submission status: Wrong Answer

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

for i in range(1, b):
  if i %3 == 0 and i %15 != 0:
    i = 'Fizz'
  elif i %5 == 0 and i %15 != 0:
    i = 'Buzz'
  elif i %15 == 0:
    i = 'FizzBuzz'
  else:
    a = a + i
        
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
  n = int(input())
  l = []
  a,b = 0,1
  for x in range(n):
    if x%15==0:
      pass
    elif x%5==0:
      pass
    elif x%3==0:
      pass
    else:
      l.append(x)
      
  print(sum(l))    


if __name__ == '__main__':
  main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
fizzbuzz = 0
fizz = 0
buzz = 0

for i in range(n):
  if i % 15 == 0:
    fizzbuzz += i
  elif i % 3 == fizz:
    fizz += i
  elif i % 5 == buzz:
    buzz += i

print(fizzbuzz + fizz +buzz)

Submission status: Wrong Answer

Solution code:
n = int(input())
ret = []

for i in range(n):
  """
  if i % 3 == 0 and i % 5 == 0:
    ret.append('FizzBuzz')
  elif i % 3 == 0:
    ret.append('Fizz')
  elif i % 5 == 0:
    ret.append('Buzz')
 
  else:
  """
  if  i % 3 != 0 and i % 5 != 0:
    ret.append(i)
print(sum(ret))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
count=0
for i in range(N):
  if not(i%3==0 or i%5==0):
    count+=i
print(count)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a, b = n // 15, n % 15

    fbeg = [i for i in range(1, 16) if i % 3 != 0 and i % 5 != 0]
    fend = [i for i in range(a * 15, n + 1) if i % 3 != 0 and i % 5 != 0]

    ne = len(fbeg)
    fbs = sum(fbeg) # sum of first terms in [1, 15]
    fes = sum(fend)
    step = 15 * ne
    first = fbs
    last = fbs + (a-1) * step

    tot = (first + last) * (last - first + step) // step // 2 + sum(fend)

    print(tot)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0
for i in range(N):
  if(i%3==0):
    continue
  elif(i%5==0):
    continue
  else:
    count+=i
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for i in range(N):
  if i % 3 != 0 or i % 5 != 0:
    ans += i
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(sum_num)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=N//500
print(A)
B=N-A*500
print(A)

Submission status: Wrong Answer

Solution code:
N = int(input())
p = 0
for i in range(N):
    if i % 3 != 0 and i % 5 != 0:
        p += i

print(p)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

sum = 0

for i in range(N):
    if not (i%3 == 0 or i%5 == 0):
        sum += i

print(sum)

Submission status: Wrong Answer

Solution code:
def palin(x):
    #print(x)
    if x == x[::-1]: return True
    return False
 
a = input()
n = len(a)
if palin(a) and palin(a[:int((n-1)/2)]) and palin(a[int((n+3)/2)-1:]):
    print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
n=int(input())


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
t=[]
for i in range(x):
  if i%3!=0 and i%5!=0:
    t.append(i)
print(sum(t))

Submission status: Wrong Answer

Solution code:
x=int(input())
t=[]
for i in range(x):
  if i%3==0 or i%5==0:
    pass
  else:
    t.append(i)
print(sum(t))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
li = []
for i in range(N):
  if i % 3 != 0 and i % 5 != 0 :
    li.append(i)
print(sum(li))

Submission status: Wrong Answer

Solution code:
n = int(input())

l = 0

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

Submission status: Wrong Answer

Solution code:
n = int(input())

l = []

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

Submission status: Wrong Answer

Solution code:
#162B
#FizzBuzz Sum

n=int(input())

print(sum(x for x in range(1,n) if x%3!=0 and x%5!=0))

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

sum_list = [0] * n

for i in range(n):
  if i % 3 == 0 or i % 5 == 0:
    pass
  else:
    sum_list[i] = i 

print(sum(sum_list))

Submission status: Wrong Answer

Solution code:
n = int(input())

sum_list = [0] * n

for i in range(n):
  if (i % 3 == 0 and i % 5 == 0) or i % 3 == 0 or i % 5 == 0:
    pass
  else:
    sum_list[i] = i 

print(sum(sum_list))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
count=0
for i in range(n):
    if i%15==0:
        if i%5==0 or i%3==0:
            count+=0
    elif i%5==0:
        count+=0
    elif i%3==0:
        count+=0
    else:
        count+=i
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
li = []
for i in range(N):
  if i % 3 != 0 and i % 5 != 0 :
    li.append(i)
print(sum(li))

Submission status: Wrong Answer

Solution code:
N = int(input())
li = []
for i in range(N):
  if i % 3 != 0 and i % 5 != 0 :
    li.append(i)
print(sum(li))
print(li)

Submission status: Wrong Answer

Solution code:
N = int(input())
li = []
for i in range(N):
  if i % 3 != 0 and 1 % 5 != 0 and i % 3 != 0 and i % 5!=0:
    li.append(i)
print(sum(li))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
l=[]
for i in range(n): 
    if ((i%3)!=0)  and ((i%5)!=0):
        l.append(i)
print(l)

Submission status: Wrong Answer

Solution code:
n = int(input())
l=[]
for i in range(n): 
    if ((i%3)!=0)  and ((i%5)!=0):
        print(i)
        l.append(i)
print(l)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
l=[]
for i in range(n+1): 
  if i%3==0:
    l.append(i)
  elif i%5==0:
    l.append(i)
print(sum(l))

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:
N=int(input())
list=[]
for i in range(N):
    if i%3==0 and i%5==0:
        list.append("FizzBuzz")
    elif i%3==0 and i%5!=0:
        list.append("Fizz")
    elif i%3!=0 and i%5==0:
        list.append("Buzz")
    else:
        list.append(i)
count=0
for i in range(N):
    if list[i]!="FizzBuzz" and list[i]!="Fizz" and list[i]!="Buzz":
        count+=list[i]
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

ans=0

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

for i in range(n):
    if i % 3 == 0 and i % 5 == 0:
        i = "FizzBuzz"
    elif i % 3 == 0:
        i = "Fizz"
    elif i % 5 == 0:
        i = "Buzz"
    else:
        s += i
    #print(i)

print(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[0,1,2,0,4,0,0,7,8,0,0,11,0,13,14]
s=0
for i in range(n):
  if a[i%15]!=0:
    s+=a[i%15]+i//15*15
print(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
num = int(input())
a = [i for i in range(1, num + 1)]
for f in a:
  if f % 3 == 0:
    a.remove(f)
  elif f % 5 == 0:
    a.remove(f)
print(sum(a))

Submission status: Wrong Answer

Solution code:
num = int(input())
a = [i for i in range(1,num)]
for f in a:
  if f % 3 == 0:
    del a[a.index(f)]
  elif f % 5 == 0:
    del a[a.index(f)]
print(sum(a))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def solve():
    N = int(input())
    suma = 0
    for i in range(N):
        if i % 3 != 0 and i % 5 != 0:
            suma += i
    print(suma)

if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
N =int(input())
i =1
a =0
while i < N:
	if i%3 != 0 and i%5 != 0:
		a +=i
	i +=1
print(a)

Submission status: Wrong Answer

Solution code:
N=int(input())

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

fb = 0

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

print(fb)

Submission status: Wrong Answer

Solution code:
# B - FizzBuzz Sum
N = int(input())
ans = 0
for i in range(N):
    if i%3!=0 and i%5!=0:
        ans += i
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ls = []
for i in range(N):
    if i%3==0 or i%5==0:
        pass
    else:
        ls.append(i)
print(sum(ls))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
ans=0
pla=0
for i in range(x+1):
  if i//3==0 or i//5==0:
    pla=pla+1
  else:
    ans=ans+i
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

a = [i for i in range(n) if i % 3 != 0 and i % 5 != 0]

print(sum(a))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
sum = 0

for i in range(x):
    if not (i % 5 == 0 or i % 3 == 0):
        sum += i


print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
sum = 0

for i in range(n):
    if i % 3 == 0 and i % 5 == 0:
        # print("FizzBuzz")
        sum += 0
    elif i % 3 == 0:
        # print("Fizz")
        sum += 0
    elif i % 5 == 0:
        # print("Buzz")
        sum += 0
    else:
        sum += i

print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(c)

Submission status: Wrong Answer

Solution code:
n=int(input())
c=0
for i in range(n):
    if not(i%3==0 or i%5==0):
        c+=i


print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())

l = []
for i in range(N+1):
    if not i % 3 == 0 and not i % 5 == 0:
        l.append(i)
print(l)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
l = []
for i in range(N+1):
    if i % 3 == 0 or i % 5 == 0:
        l.append(i)
print(sum(l))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list()
for i in range(1,N):
    if i %3 != 0 and i%5 != 0:
        a.append(i)
    else:
        continue
#print(a)
print(sum(a))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list()
for i in range(1,N):
    if i %3 != 0 and i%5 != 0:
        a.append(i)
    else:
        continue
#print(a)
sum(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
if n / 15 == 0:
    n = 8
elif n / 3 == 0:
    n = 4
elif n / 5 == 0:
    n = 4
    total = 0
    for i in range(1, n +1):
        total += i
        print(total)

Submission status: Wrong Answer

Solution code:
# unihernandez22
# https://atcoder.jp/contests/abc162/tasks/abc162_b
# simulation
ans = 0
for i in range(int(input())):
    if not (i%3 == 0 or i%5 == 0):
        ans += i
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

samu = 0

for i in range(n):
    if(n % 3 != 0 or n % 5 != 0):
        samu += i

print(str(int(samu)))

Submission status: Wrong Answer

Solution code:
n = int(input())

samu = 0

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

print(str(int(samu)))

Submission status: Wrong Answer

Solution code:
n = int(input())
all_sum = n * (n + 1)/2

number_3 = n//3
number_5 = n//5
number_15 = n//15

sum_number_3 = 3 * (number_3 * (number_3 + 1)/2)
sum_number_5 = 5 * (number_5 * (number_5 + 1)/2)
sum_number_15 = 15 * (number_15 * (number_15 + 1)/2)

sum_not_number = sum_number_3 + sum_number_5 - sum_number_15

s = all_sum - sum_not_number

print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())
all_sum = n * (n + 1)/2

number_3 = n//3
number_5 = n//5
number_15 = n//15

sum_number_3 = number_3 * (number_3 + 1)/2
sum_number_5 = number_5 * (number_5 + 1)/2
sum_number_15 = number_15 * (number_15 + 1)/2

sum_not_number = sum_number_3 + sum_number_5 - sum_number_15

s = all_sum - sum_not_number

print(s)

Submission status: Wrong Answer

Solution code:
K=int(input())
n=0
for i in range(1,K+1):
    if(i%3==0):
        pass
    elif(i%5==0):
        pass
    elif(i%3==0 and i%5==0):
        pass
    else:
        n+=i

print()

Submission status: Wrong Answer

Solution code:
K=int(input())
n=0
for i in range(1,K+1):
    if(i%3==0 and i%5==0):
        pass
    else:
        n+=i

print(n)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

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

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

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

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

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

Submission status: Wrong Answer

Solution code:
n = int(input())

total = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
x=0
for i in range(1,1+N):
  if (N % 3) != 0 or (N%5) !=0:
    x = x + i
print(x)

Submission status: Wrong Answer

Solution code:
N = int(input())
x=0
for i in range(1,1+N):
  if N % 3 != 0 or N%5 !=0:
    x = x + i
print(x)

Submission status: Wrong Answer

Solution code:
N = int(input())
x = 0
for i in range(1,1+N):
  if N % 3 != 0 or N%5 !=0:
    x += i
print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
FizzBizz = int(input())

Sum = []
for i in range(FizzBizz):
    if i % 3 != 0 and i % 5 != 0:
        Sum.append(i)
    else:
        Sum.append(0)
print(sum(Sum))

Submission status: Wrong Answer

Solution code:
FizzBizz = int(input())

Sum = []
for i in range(1, FizzBizz):
    if i % 3 != 0 and i % 5 != 0:
        Sum.append(i)
    else:
        Sum.append(0)
print(sum(Sum))

Submission status: Wrong Answer

Solution code:
def total(n):
    return n*(n+1)*0.5

n = int(input())
ans = total(n) - total(n/3)*3 - total(n/5)*5 + total(n/15)*15
print(int(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for i in range(N):
    if i % 3 == 0 or i % 5 != 0:
        ans += i

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

l = [int(x) for x in list(str(N))]

if 7 in l:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N = int(input())
N3 = N//3
N5 = N//5
N15 = N//15

S = N * (N+1) / 2
S3 = N3 * (N3+1) / 2 *3
S5 = N5 * (N5+1) / 2 *5
S15 = N15 * (N15+1) / 2 *15

sum = S - (S3 + S5 -S15)
print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: <encoding name> -*-

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(sum)

Submission status: Wrong Answer

Solution code:
U = int(input())
k = 0
l = 0
m = 0
for i in range(1, U + 1) :
  if i / 3 == 0 and i/5 == 0:
    k += i
    break
  elif i / 3 == 0:
    l += i
    break
  elif i / 5 == 0:
    m += i
    break
  else:
    k += 0
print(int(U) - int(l + m - k))

Submission status: Wrong Answer

Solution code:
def main():
        N = int(input())

        record = []

        for i in range(1,N):
                if i%3==0 or i%5==0:
                        record.append(0)
                else:
                        record.append(i)

        print(sum(record))


if __name__=="__main__":
        main()

Submission status: Wrong Answer

Solution code:
N = int(input())
S = []
for i in range(N):
    if i%3==0 and i%5==0:
        i = "FizzBuzz"
    elif i%3==0:
        i = "Fizz"
    elif i%5==0:
        i = "Buzz"
    else:
        i = i
        S.append(i)
print(sum(S))

Submission status: Wrong Answer

Solution code:
n = int(input())

l=list(range(1,n+1))
print(l)

count=0

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

Submission status: Wrong Answer

Solution code:
num = int(input())
list = []
result = 0
for i in range(num):
  if i % 15 == 0 or i%3 == 0 or i%5 == 0:
    continue
  else :
    result += i
    
print(result)

Submission status: Wrong Answer

Solution code:
num = int(input())
list = []
for i in range(num):
  if i % 15 == 0 or i%3 == 0 or i%5 == 0:
    continue
  else :
    list.append(i)
    
result = 0
for item in list:
  result += item

print(result)

Submission status: Wrong Answer

Solution code:
num = int(input())
list = []
for i in range(num):
  if i % 15 == 0:
    continue
  elif i%3 == 0:
    continue
  elif i%5 == 0:
    continue
  else :
    list.append(i)
    
result = 0
for j in list:
  result += j

print(result)