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())
fizzbuzz = []
for i in range(1,N):
    if i % 5 != 0 and i % 3 != 0:
        fizzbuzz.append(i)

print(sum(fizzbuzz))

Submission status: Wrong Answer

Solution code:
N = int(input())

FB = []
for i in range(N):
    if i % 3 ==0 or i % 5 ==0:
        FB.append(0)
    else:
        FB.append(i)

print(sum(FB))

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:
a = input()
aList = []
for i in range(1,int(a)+1):
    if i%3 == 0 and i%5 == 0:
        print('FizzBuzz')
    elif i%3 == 0:
        print('Fizz')
    elif i%5 == 0:
        print('Buzz')
    else:
        aList.append(i)
        print(i)
ans = 0
for _,b in enumerate(aList):
    ans = ans + b
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

k15 = N // 15
m = N - (15 * k15)

k3 = m // 3
k5 = m // 5

def sigma(n):
  ans = n * (n + 1) / 2
  return ans

sum = (3 * sigma(k3)) + (5 * sigma(k5)) - (15 * sigma(k15))

print(sum)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
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())
last_fizz = (N / 3) * 3
last_buzz = (N / 5) * 5
last_fibu = (N / 15) * 15

N_sum = N * (N + 1) / 2
if N >= 3:
  fizz_sum = (N / 3) * (3 + last_fizz) / 2
  N_sum -= fizz_sum
if N >= 5:
  buzz_sum = (N / 5) * (5 + last_buzz) / 2
  N_sum -= buzz_sum
if N >= 15:
  fibu_sum = (N / 15) * (15 + last_fibu) / 2
  N_sum += fibu_sum
print(N_sum)

Submission status: Wrong Answer

Solution code:
a=int(input())
fizzbuzz = 0
for i in range(1,a+1):
  if (i%3) == 0:
      fizzbuzz += i
  elif (i%5) == 0:
      fizzbuzz += i
all_ = (1+a)*a/2
print(all_-fizzbuzz)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(fb)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    temp = 0
    for count in range(N):
        if count % 3 == 0 or count % 5 == 0:
            pass
        else:
            temp += count
    print(temp)
resolve()

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

k = N // 15
ans = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

N = [i for i in range(1, N) if i % 15 != 0]
N = [i for i in N if i % 3 != 0]
N = [i for i in N if i % 5 != 0]

print(sum(N))

Submission status: Wrong Answer

Solution code:
N = int(input())
L = []
for i in range(1,(10**6)+1):
    if (i % 3 == 0) | (i % 5 == 0):
        L.append(i)
    else:
        L.append(0)

l = L[:N+1]
ans = sum(l)
print(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 = ans + i
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

x = 0

for i in range(N):
    if i % 15 == 0:
        #FB
        pass
    elif i % 3 == 0:
        #F
        pass
    elif i % 5 == 0:
        #B
        pass
    else:
        x += i

print(x)

Submission status: Wrong Answer

Solution code:
m = int(input())
 
def fizz_buzz(i):
  fizz = i % 3
  buzz = i % 5
  
  return (fizz > 0) & (buzz > 1)
 
res = 0
 
for i in range(m):
  use_i = i+1
  if fizz_buzz(use_i):
    res += use_i

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

FB_list = []
FB_all = 0
FB_non = 0
for i in range(1,n+1):
    FB_all += i
    if (i % 3 == 0 and i % 5 == 0) or (i % 3 != 0 and i % 5 == 0) or (i % 3 == 0 and i % 5 != 0):
        FB_list.append(0)
    else:
        FB_list.append(i)
FB_non = sum(FB_list)
print((FB_all) - (FB_non))

Submission status: Wrong Answer

Solution code:
N = int(input())

sum = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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")
        continue
    elif i % 3 == 0:
        List.append("Fizz")
        continue
    elif i % 5 == 0:
        List.append("Buzz")
        continue
    List.append(i)
Remove_Str = [x for x in List if not isinstance(x, str)]
print(sum(Remove_Str))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int):
    ans = []
    for i in range(N):
        if i % 3 == 0 or i % 5 == 0:
            continue
        ans.append(i)
    print(sum(ans))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N=int(input())
print('N=',N)
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())
sum=0
for i in range(n):
  if i%15==0:
    continue
  elif i%3==0:
    continue
  elif i%5==0:
    continue
  else:
    sum+=i
print(str(sum))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())

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

print(S)

Submission status: Wrong Answer

Solution code:
count = 0
for i in range(1, 61):
  if i%3 and i%5:
    count += i
print(count)

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:
# 入力は一行のみで[数値]

input_num = int(input())

answer = 0

for i in range(input_num):
    if i%3 == 0:
        pass
    elif i%5 == 0:
        pass
    else:
        answer = answer + i

print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

  counter = 0

  for i in range(N):
    if i%3 == 0 and i%5 == 0:
      pass
    elif i%3 == 0 :
      pass
    elif i%5 == 0:
      pass
    else:
      counter += i
    
  print(counter)


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

Submission status: Wrong Answer

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N=int(input())

count=0
for i in range(N):
    if i %15==0:
        i="FizzBuzz"
    elif i%3==0:
        i="Fizz"
    elif i%5==0:
        i="Buzz"
    else:
        count+=i
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

a = N//15
b = N%15

def f(m):
  if m == 0:
    return 0
  elif m == 1:
    return 1
  elif m == 2 or m == 3:
    return 3
  elif m == 4 or m == 5 or m == 6:
    return 7
  elif m == 7:
    return 14
  elif m == 8 or m == 9 or m == 10:
    return 22
  elif m == 11 or m == 12:
    return 33
  elif m == 13:
    return 46
  elif m == 14:
    return 60

print(60*a + f(b))

Submission status: Wrong Answer

Solution code:
import sys
N=input()
N=int(N)
a=int(N/3)
b=int(N/5)
c=int(N/15)
S=N*(N+1)/2 - 3*a*(a+1)/2 - 5*b*(b+1)/2 + 15*c*(c+1)/2
print(S)

Submission status: Wrong Answer

Solution code:
a=int(input())
x=(a*(1+a))/2
print(x)
if a>2:
    x-=(a//3)*(3+((a//3)*3))/2
    print(x)
if a>4:
    x-=(a//5)*(5+((a//5)*5))/2
    print(x)
if a>14:
    x+=(a//15)*(15+((a//15)*15))/2
print(int(x))

Submission status: Wrong Answer

Solution code:
def main():
    i = int(input())
    print(sum([j for j in range(1, i) if j % 3 != 0 and j % 5 != 0]))


main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())

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

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())

b = []

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

print(sum(b))

Submission status: Wrong Answer

Solution code:
N = int(input())
A=N//3
B=N//5
AanB=N//15
Ssum=(1+N)*N*(1/2)
Asum=(1+A)*A*(1/2)*3
Bsum=(1+B)*B*(1/2)*5
AanBsum=(1+AanB)*AanB*(1/2)*15
print(Ssum-Asum-Bsum-AanBsum)

Submission status: Wrong Answer

Solution code:
N = int(input())
n3=N//3
n5=N//5
n15=N//15
S3 = 0.5*n3*(2*3+(n3-1)*3)
S5 = 0.5*n5*(2*5+(n5-1)*5)
S15 = 0.5*n15*(2*15+(n15-1)*15)
S=(N+1)*N/2
print(S-S3-S5+S15)

Submission status: Wrong Answer

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

print(result)

Submission status: Wrong Answer

Solution code:
s=int(input())
list=[]
h=0
for i in range(1,s):
    if i%3!=0 or i%5!=0:
        list.append(i)
for j in list:
    h=h+j
print(h)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python

import sys

N = int(sys.stdin.readline())

nfizz = N // 3
nbuzz = N // 5
nfizzbuzz = N // 15

tot = (1 + N) * N / 2
tot_fizz = 3 * (1 + nfizz) * nfizz / 2
tot_buzz = 5 * (1 + nbuzz) * nbuzz / 2
tot_fizzbuzz = 15 * (1 + nfizzbuzz) * nfizzbuzz / 2

tot = tot - (tot_fizz + tot_buzz - tot_fizzbuzz)

print(tot)

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

print(sum)

Submission status: Wrong Answer

Solution code:
n = input()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def check(q):
    if q % 15 == 0:
        return 0
    elif q %5 == 0:
        return 0
    elif q % 3 == 0:
        return 0
    else:
        return q

a = int(input())
b = 0

for i in range(a):
    b += check(i)

print(b)

Submission status: Wrong Answer

Solution code:
import sys
# sys.stdin = open('input.txt')

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 = []
ans_num = 0
for i in range(15):
    s = i+1
    if(s%3 == 0 and s%5 == 0):
        ans.append("FizzBuzz")
    elif(s%3 == 0):
        ans.append("Buzz")
    elif(s%5 == 0):
        ans.append("Buzz")
    else:
        ans.append(s) 
        ans_num += s

print(ans_num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    print(sum(i for i in range(N+1) if i % 3 == 0 or i % 5 == 0))
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

print(sum_)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
i=0
k=0
ans=0
nums =[]
while(i<N):
    if(i%3!=0) and (i%5!=0):
        nums.append(i)
        k+=1
    i+=1
for k in range(0,k):
    ans+=nums[k]
print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(sum_num)

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    sum = 0
    for i in range(N):
        if i % 3 == 0:
            continue
        if i % 5 == 0:
            continue
        else:
            sum += i

    print(sum)




main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

FB_sum = 0
for i in range(N):
    if i % 3 == 0 or i % 5 == 0:
        pass
    else:
        FB_sum += i

print(FB_sum)

Submission status: Wrong Answer

Solution code:
n = int(input())

lst_3 = list(range(n))
lst_5 = list(range(n))
lst_15 = list(range(n))
del lst_3[3::3]
del lst_5[5::5]
del lst_15[15::15]

lst = list(set(lst_3) & set(lst_5) & set(lst_15))
print(sum(lst))

Submission status: Wrong Answer

Solution code:
N = int(input())
total = 0

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

print(total)

Submission status: Wrong Answer

Solution code:
N = int(input())

count = 0
for i in range(N):
    if i % 15 == 0:
        i = 'FizzBuzz'
    elif i % 3 == 0:
        i = 'Fizz'
    elif i % 5 == 0:
        i = 'Buzz'
    else:
        count += i
print(count)

Submission status: Wrong Answer

Solution code:
import numpy as np
#N=map(int, input().split())
N=int(input())
count=0
for i in range(0,N):
    if i%3!=0 and i%5!=0:
        count=count+i
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

fizzbuzz = []
for i in range(n):
    if i %3 != 0 and i % 5 != 0:
        fizzbuzz.append(i)

print(sum(fizzbuzz))

Submission status: Wrong Answer

Solution code:
N = int(input())

sum = 0

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

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

Submission status: Wrong Answer

Solution code:
import math
import string
import collections
from collections import Counter
from collections import deque
import sys
sys.setrecursionlimit(2*10**5)
INF = 2**60


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


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


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]


N = int(input())
a = []
ans = []
for i in range(1, N+1):
    a.append(i)
# print(a)
for i in range(len(a)):
    if i % 3 != 0 and i % 5 != 0 and i % 15 != 0:
        ans.append(i)
    if i % 3 == 0:
        ans.append('Fizz')
    if i % 5 == 0:
        ans.append('Buzz')
    if i % 15 == 0:
        ans.append('FizzBuzz')
# print(ans)
sum = 0
for i in range(len(ans)):
    if ans[i] != 'FizzBuzz' and ans[i] != 'Fizz' and ans[i] != 'Buzz':
        sum += ans[i]
print(sum)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = 0

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

print(B)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

def FB(n):
  if n%3 != 0 and n%5 !=0:
    return n
  else:
    return False

ans = 0
for i in range(N):
  ans += FB(i)

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
print(4*(n**2)//15)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [0]*N
for i in range(1, N):
    a[i-1] = i
    if i % 15 == 0 or i % 3 == 0 or i % 5 ==0:
        a[i-1] =0
print(sum(a))

Submission status: Wrong Answer

Solution code:
def result(N):
    answer=0
    for i in range(N+1):
        if(i%3==0):
            answer+=i
        elif(i%5==0):
            answer+=i
    return answer

N = int(input())
print(result(N))

Submission status: Wrong Answer

Solution code:
n=int(input())
ret = n*(n+1)//2
ret -= 3*(1+n//3)//2
ret -= 5*(1+n//5)//2
ret += 15*(1+n//15)//2
print(ret)

Submission status: Wrong Answer

Solution code:
print(sum(i for i in range(int(input())) if i%3 and i%5))

Submission status: Wrong Answer

Solution code:
import numpy as np

if __name__ == "__main__":
    N = int(input())
    num_ls = np.arange(0,N)
    n = num_ls[(num_ls % 5 != 0) & (num_ls % 3 != 0)].astype(np.float64)
    ret = 0
    ret = sum(n)
    print(int(ret))

Submission status: Wrong Answer

Solution code:
a=int(input())

l = [0]*a
for i in range(a):
    if i%3 == 0:
        l[i] = 0
    elif i%5 == 0:
        l[i] = 0
    else:
        l[i] = i

print(sum(l))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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())
sum_n=0
for i in range(n):
    if i%3==0:
        pass
    elif i%5==0:
        pass
    else:
        sum_n+=i
print(sum_n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

count = 0
for i in range(int(N)+1):
    if i % 15 == 0:
        print('FizzBuzz')
    elif i % 5 ==0:
        print('Buzz')
    elif i % 3 ==0:
        print('Fizz')
    else:
        count += i
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(n)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = N//15
b = N%15
ans = 60*a**2
for i in range(1,b+1):
  if i%3!=0 and i%5!=0:
    ans += i+15*(a+1)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
q = int(input())

sum = 0
for num in range(1, q):
    # say=""
    if num % 3 == 0:
        continue
        # say = "Fizz"
    elif num % 5 == 0:
        continue
        # say = say+"Buzz"
    else:
        sum += num

print(sum)

Submission status: Wrong Answer

Solution code:
N_s=input()
N=int(N_s)
ans=0
for i in range(N):
    if ((i%3!=0) and (i%5!=0)):
        ans=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:
# -*- coding: utf-8 -*-
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 n in range(N):
    if n%3==0 or n%5==0:
        pass
    else:
        ans+=n
print(ans)

Submission status: Wrong Answer

Solution code:
a=int(input())

set3 = set(range(0,a,3))
set5 = set(range(0,a,5))
seta = set(range(0,a))

print(sum(seta-set3-set5))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(cnt)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
n=int(input())
li=[]
for i in range(1,n+1):
    li.append(i)
sum=0
for j in li:
    if j%15==0:
        sum+=j
    elif j%3==0:
        sum+=j
    elif j%5==0:
        sum+=j
print(sum)

Submission status: Wrong Answer

Solution code:
import itertools
##print(ord("A"))
n = int(input())
ans = 0
for i in range(n):
    if i %3==0 or i%5==0:
        pass
    else:
        ans += i
        #print(i)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
import numpy as np
narray=np.array(range(n))
tempsum=[]
for i in narray:
    if i%3!=0 and i%5!=0:
        tempsum.append(i)
        #print(i)
print(np.sum(tempsum))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=0
N=1
for i in range(N):
  N+=1
  if N//3 and N//5:
    pass
  elif N//3:
    pass
  elif N//5:
    pass
  else:
    ans=ans+N
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
array = np.arange(0, N)
fizz_buzz = np.array([i for i in array if i%3 == 0 or i%5 == 0])

print(np.sum(array) - np.sum(fizz_buzz))

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
# 整数の入力
n = int(input())
s = 0
for i in range(1, n):
    if i % 3 != 0 and i % 5 != 0:
        s += i
print(s)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
input = stdin.readline
import math

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def solve(n):
    arr = [i for i in range(n) if i % 3 != 0 and i % 5 != 0]
    print(sum(arr))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
list = []
for i in range(1,1000010):
  if(i%3==0 or i%5==0):
    list.append(0)
  else:
    list.append(i)
n = int(input())
print(list[:n-1])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

value=sum(array)
print(value)

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

print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
N  = int(input())
sum = 0

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

print(sum)