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:
# coding: utf-8

import sys
import math
import collections
import itertools
INF = 10 ** 13
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def lcm(x, y) : return (x * y) // math.gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def LS() : return input().split()
def RS(N) : return [input() for _ in range(N)]
def LRS(N) : return [input().split() for _ in range(N)]
def PL(L) : print(*L, sep="\n")
def YesNo(B) : print("Yes" if B else "No")
def YESNO(B) : print("YES" if B else "NO")

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)

sum = 0

for i in a:
  sum += i

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = []

for i in range(N):
  if i % 15 != 0 and i % 3 != 0 and i % 5 != 0:
    a.append(i)

sum = 0

for i in a:
  sum += i

print(sum)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000)

N = int(input())
sum = 0

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(fizz_bazz)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A=int(input())

res=0
k=0
for i in range(15):
  if (i+1) % 3 == 0:
    k=0
  elif (i+1) % 5 == 0:
    k=0
  else:
    res+= (i+1)
    
print(res)

Submission status: Wrong Answer

Solution code:
num=int(input())

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

print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=0
for i in range(1,int(input())+1):
  a+=(not (i%3 or i%5))*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:
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(e)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

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

Submission status: Wrong Answer

Solution code:
#! /usr/bin/env python
# -*- coding: utf-8 -*-

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

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

Solution code:
num = int(input('')) #input()で入力を受け取ってint()で数字型に変換します。

ans_sum = 0

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

Submission status: Wrong Answer

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

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 = input()
a = 0
for i in range(int(n)):
    if i%3 != 0:
        if i%5 !=0:
            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:
N = int(input())

sum = 0
l = [1] * N

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

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

print(str(sum))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
m = sum(range(1,n+1)) #1~nまでの総和を出している#
s = 0
g = 0
i = 0


while i <= n:
    i += 3
    s += i
    
s -= i
i =0

while i <= n:
    i += 5
    if (i % 3) != 0: 
        g += i

g -= i
print(int(m)-int(s)-int(g))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#FizzでもBuzzでもないものの総和
s = int(input())
print(s)
ans =0

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

Submission status: Wrong Answer

Solution code:
#FizzでもBuzzでもないものの総和
s = int(input())
#print(s)
ans =0

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

Submission status: Wrong Answer

Solution code:
def fizzbuzz(n):
  m = 0
  for i in range(n):
    if i % 5 != 0 and i % 3 != 0:
      m += i
  return m

n = int(input())
print(fizzbuzz(n))

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:
a = int(input())
lists = [i+1 for i in range(a)]
for t in lists:
  if t % 5 == 0:
    lists.remove(t)
  elif t % 3 ==0:
    lists.remove(t)
    
print(sum(lists))

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

Submission status: Wrong Answer

Solution code:
n=int(input())

a=[]
sum=0
for i in range(n):
    if i%3==0 and i%5==0:
        a.append('FizzBuzz')
    elif i%3==0:
        a.append('Fizz')
    elif i%5==0:
        a.append('Buzz')
    else:
        a.append(i)
        sum=sum+a[i]

print(int(sum))

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('FizzBuzz')
    elif i%3==0:
        a.append('Fizz')
    elif i%5==0:
        a.append('Buzz')
    else:
        a.append(i)

sum=0
for i in range(n):
    if type(a[i]) is int:
        sum=sum+a[i]

print(int(sum))

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('FizzBuzz')
    elif i%3==0:
        a.append('Fizz')
    elif i%5==0:
        a.append('Buzz')
    else:
        a.append(i)

sum=0
for i in range(n):
    if type(a[i]) is int:
        sum=sum+a[i]

print(sum)

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('FizzBuzz')
    elif i%3==0:
        a.append('Fizz')
    elif i%5==0:
        a.append('Buzz')
    else:
        a.append(i)

sum=0
for ai in a:
    if type(ai) is int:
        sum=sum+ai

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

Submission status: Wrong Answer

Solution code:
a=int(input())

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

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
    else:
        ans += 0
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:


N = int(input() )
a = []
num = 0
for i in range(1,N):
    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)

Submission status: Wrong Answer

Solution code:
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, 0]
    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, 33, 46, 60]
    ans = X * 60 + (X-1) * X // 2 * 120 + cnt[Y] * (15*X) + csm[Y]
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
total = 0
for i in range(1,N):
    if i % 3 == 0 and i % 5 == 0:
        continue
    elif i % 3 == 0:
        continue
    elif i % 5 == 0:
        continue
    else:
        total += i
    

print(total)

Submission status: Wrong Answer

Solution code:
N = int(input())
fizzbuzz = []

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
n = int(input())
count = 0
sum = 0
while count < n:
    if count % 3 != 0 and count % 5 != 0:
        sum += count
    count += 1
print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


if __name__ == "__main__":
    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:
    sum += 0
  else:
    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:
N=int(input())
P=0
for i in range(N+1):
    if i%3==0 or i%5==0:
        P+=i
print(P)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=int(input())
count=int(1)
sum=int(0)
while(count!=s):
    if count%3==0 and count%5==0:
        pass
    elif count%3==0:
        pass
    elif count%5==0:
        pass
    else:
        sum+=int(count)
    count+=int(1)
print(int(sum))

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

n = int(input())

ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

if N % 15 == 0 :
  print('FuzzBuzz')
elif N % 3 == 0:
  print('Fuzz')
elif N % 5 == 0:
  print('Buzz')
else:
  print(N)

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

Submission status: Wrong Answer

Solution code:
sum([i for i in range(1, 1+int(input())) if i%3 * i%5])

Submission status: Wrong Answer

Solution code:
#input
N = int(input())

#output
answer = 0
for i in range(N):
    if i % 5 == 0:
        continue
    elif i % 3 == 0:
        continue
    elif i % 15 == 0:
        continue
    else:
        answer += i

print(answer)

Submission status: Wrong Answer

Solution code:
#input
N = int(input())

#output
answer = 0
for i in range(N):
    if i % 5 == 0 or i % 3 == 0 or i % 15 == 0:
        continue
    else:
        answer += i

print(answer)

Submission status: Wrong Answer

Solution code:
#input
N = int(input())

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

print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = int(input())

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

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())
l=[]
for i in range(n+1):
    if i%3==0:
        pass
    elif i%5==0:
        pass
    elif i%15==0:
        pass
    else:
        l.append(i)
print('l',l)
        
print(sum(l))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
input_n = input()
N = int(input_n)
print(["FizzBuzz" if i%15==0 else "Fizz" if i%3==0 else "Buzz" if i%5==0 else i for i in range(1,N+1)])

Submission status: Wrong Answer

Solution code:
print(["FizzBuzz" if i%15==0 else "Fizz" if i%3==0 else "Buzz" if i%5==0 else i for i in range(1,int(input()))])

Submission status: Wrong Answer

Solution code:
print(["FizzBuzz" if i%15==0 else "Fizz" if i%3==0 else "Buzz" if i%5==0 else i for i in range(1,101)])

Submission status: Wrong Answer

Solution code:
n = int(input())
res = n*(n+1)/2
uc = n/3
bes = n/5
onbes = n/15
print(res - 3*uc*(uc+1)/2 - 5*bes*(bes+1)/2 + 15*onbes*(onbes+1)/2)

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:
def f(i,j,k):
  if(i==1 or j==1 or k==1):
  	return 1
  l=[i,j,k]  
  l.sort()
  i=l[0]
  j=l[1]
  k=l[2]
  if j%i !=0 or k%i !=0 or k%j !=0:
    return 1
  if (j%i ==0):
    if k%(j//i)==0:
      return j//i
    
    

n=int(input())
sum=0
for i in range(1,n):
  for j in range(1,n):
    for k in range(1,n):
      print(i," ",j," ",k, " ")
      sum+=f(i,j,k)
print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
s = N*(N+1)/2

p = N//3
q = N//5
r = N//15

pp = p*(p+1)*3/2
qq = q*(q+1)*5/2
rr = r*(r+1)*15/2

print(s-pp-qq+rr)

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

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

print(sum(l))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7 # 998244353
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    n = int(input())
    res = 0
    for i in range(1, n):
        if i % 3 and i % 5:
            res += i
    print(res)
resolve()

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(i)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# B - FizzBuzz Sum
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:
def S(n):
  return n*(n-1)//2

N = int(input())
print(S(N)-S(N//3)*3-S(N//5)*5+S(N//15)*15)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def fizz(k,count):
    if k ==0:
        return 0
    else:
        for n in range(k):
            if n%3==0 and n%5==0:
                continue
            elif n%3==0 and n%5!=0:
                continue
            elif n%5==0 and n%3!=0:
                continue
            else:
                count += n

    return count

n = int(input())
print(fizz(n,0))

Submission status: Wrong Answer

Solution code:
def fizz(k,count):
    for n in range(k):
        if n%3==0 and n%5==0:
            pass
        elif n%3==0 and n%5!=0:
            pass
        elif n%5==0 and n%3!=0:
            pass
        else:
            count += n

    return count

n = int(input())
print(fizz(n,0))

Submission status: Wrong Answer

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

print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=input()
n=int(N)
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())  #スペース抜きの複数行,１文字ずつ
 
A = []
for i in range(1,N):
  if i % 15 == 0:
    A.append(0)
  elif i % 3 == 0:
    A.append(0)
  elif i % 5 == 0:
    A.append(0)
  else:
    A.append(i)

print(sum(A))

Submission status: Wrong Answer

Solution code:
N = int(input())  #スペース抜きの複数行,１文字ずつ
 
A = []
for i in range(1,N):
  if i % 15 == 0:
    A.append(0)
  if i % 3 == 0:
    A.append(0)
  elif i % 5 == 0:
    A.append(0)
  else:
    A.append(i)

print(sum(A))

Submission status: Wrong Answer

Solution code:
N = int(input())  #スペース抜きの複数行,１文字ずつ
 
A = []
for i in range(1,N):
  if i % 3 == 0:
    A.append(0)
  elif i % 5 == 0:
    A.append(0)
  else:
    A.append(i)

print(sum(A))

Submission status: Wrong Answer

Solution code:
from math import gcd
 
k = int(input())
sum_ = 0
for a in range(1, k + 1):
  for b in range(1, k + 1):
    gcd_ab = gcd(a, b)
    for c in range(1, k + 1):
      sum_ += gcd(c, gcd_ab)
print(sum_)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(ans)

Submission status: Wrong Answer

Solution code:
from math import gcd

k = int(input())

cnt = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for k in range(1, k+1):
            cnt += gcd(gcd(i, j), k)

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())
b = []

for i in range(1, a):
    if i % 15 == 0:
      pass
    elif i % 3 == 0:
      pass
    elif i % 5 == 0:
      pass
    else:
      b.append(i)
print(sum(b))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
print('Yes' if '7' in N else 'No')

Submission status: Wrong Answer

Solution code:
n = int(input())

def f(num):
  return num*(num+1)/2

n1 = int(n/3)
n2 = int(n/5)
n3 = int(n/15)

sm = f(n)- 3*f(n1)-5*f(n2) + 15*f(n3)
# f(n)- 3*f(int(n/3))

print(sm)