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: Runtime Error

Solution code:
n = int(input())
sum = 0
 
for i in range(n+1):
    if i % 3 == 0:
        print(Fizz)
    elif i % 5 == 0:
        print(Buzz)
    elif i % 15 == 0:
        print(FizzBuzz)
    else:
     sum += i
 
print (sum)

Submission status: Runtime Error

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

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

print (sum)

Submission status: Runtime Error

Solution code:
n = longlong(input())

a = 0


for i in n:
	if(n%i*3 == 0 and n%i*5 == 0):
      a += i
    elif(n%i*3 == 0):
      a += i
    elif(n%i*5 == 0):
      a += i
print(i)

Submission status: Runtime Error

Solution code:
N = int(import())
Ans = 0
for i in range(1,N):
  if not i % 3 == 0:
    if not i % 5 == 0:
      Ans = Ans + i
Ans

Submission status: Runtime Error

Solution code:
N = int(import())
Ans = 0
for i in range(1,N):
  if not i % 3 == 0:
    if not i % 5 == 0:
      print(i)
      Ans = Ans + i
Ans

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
seq = raw_input()

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

Submission status: Runtime Error

Solution code:
seq = raw_input()

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

Submission status: Runtime Error

Solution code:
seq = int(raw_input())

sum = 0
for i in range(1, seq+1, 1):
    if ((i % 3) != 0) & ((i % 5) != 0):
        sum = sum + i
print(sum)

Submission status: Runtime Error

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

if n % 15 == 0:
  print("FizzBuzz")
elif n % 3 == 0:
  print("Fizz")
elif n % 5 == 0:
  print("Buzz")
else:
  lst += n

print(lst)

Submission status: Runtime Error

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

if n % 15 == 0:
  print("FizzBuzz")
elif n % 3 == 0:
  print("Fizz")
elif n % 5 == 0:
  print("Buzz")
else:
  lst.push(n)

print(lst)

Submission status: Runtime Error

Solution code:
N = input()

a = 0

for val in range(1, N+1):
  if val%3 != 0 and val%3 != 0:
    a += val
  
print(a)

Submission status: Runtime Error

Solution code:
N = input()

a = 0

for val in range(1, N+1):
  if val%3 != 0 and val%3 != 0:
    a += val
  else:
    pass
  
print(a)

Submission status: Runtime Error

Solution code:
L = []
for i in range(N):
    if (i+1)%3 == 0 and (i+1)%5 == 0:
        L.append("FizzBuzz")
    elif (i+1)%3 == 0:
        L.append("Fizz")
    elif (i+1)%5 == 0:
        L.append("Buss")
    else:
        L.append(i+1)

sum = 0
for item in L:
    if item!= "Buss" and item!="FizzBuzz" and item!= "Fizz":
        sum = sum + item
print(sum)

Submission status: Runtime Error

Solution code:
n = [int(i+1) for i in range(input())]

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

Submission status: Runtime Error

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

print(sum)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;
  	cin>>n;
  	int sum=0;
  	for(int i=1;i<n;i++){
      if(i%3!=0&&i%5!=0)
        	sum+=i;
    }
  	cout<<sum<<"\n";
  
 return 0; 
}

Submission status: Runtime Error

Solution code:
print(sum([n for n in range(1, int(inpt())) if (n%3!=0) and (n%5!=0)]))

Submission status: Runtime Error

Solution code:
import sys
import numpy as np
n = int(input())
A = np.arrange(N+1)
count=0

for i in range(N+1):
  if A[i]%3 !=0 and A[i]%5 != 0 and A[i]%15 != 0:
	count = count + A[i]
print(count)

Submission status: Runtime Error

Solution code:
sum([n for n in range(1, int(inpt())) if (n%3!=0) and (n%5!=0)])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

n = int(input())
l = [i for i in range(1, n+1)
nl = []
    
for a in l:
     if a%15 != 0 or a%5 != 0 or a%3 != 0:
     	nl.append(a)
print(sum(nl))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
input = lambda: sys.stdin.readline().rstrip("\r\n");ii = lambda: int(input());ll = lambda: list(map(int , input().split()));vv = lambda: map(int , input().split());pr = print
pl = lambda l: pr(" ".join(list(map(str,l))))
import math
def fun(n):
    tot = n * (n+1)
    tot//=2
    return

n = ii()
print(fun(n) - 3*fun(n//3) -5*fun(n//5) + 15*fun(n//15))

Submission status: Runtime Error

Solution code:
1<=N<=10**6
if N%3 != 0 and N%5 != 0:
  N = num
print(sum(num))

Submission status: Runtime Error

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

for a in range(N):
  if a % 3 !=0 and a % 5 != 0:
    a="FizzBuzz"
    fizz_bazz += a
  elif a % 3 !=0:
    a="Fizz"
  elif a % 5 !=0:
    a="Bazz"
  else:
    continue

print(fizz_bazz)

Submission status: Runtime Error

Solution code:
N=list(map(int,input()))
fizz_bazz=0

for a in range(N):
  if a % 3 !=0 and a % 5 != 0:
    a="FizzBuzz"
    fizz_bazz += a
  elif a % 3 !=0:
    a="Fizz"
  elif a % 5 !=0:
    a="Bazz"
  else:
    continue

print(fizz_bazz)

Submission status: Runtime Error

Solution code:
N=list(map(int,input()))
fizz_bazz=int(0)

for a in range(N):
  if a % 3 !=0 and a % 5 != 0:
    a="FizzBuzz"
    fizz_bazz += a
  elif a % 3 !=0:
    a="Fizz"
  elif a % 5 !=0:
    a="Bazz"
  else:
    continue

print(fizz_bazz)

Submission status: Runtime Error

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

print(k)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = 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: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

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

for i in range(N + 1):
  if i % 15 == 0:
    ai = FizzBuzz
  if i % 3 == 0 and i % 5 =! 0:
    ai = Fizz
  if i % 3 =! 0 and i % 5 == 0:
    ai = Buzz
  else:
    ai = i
  
  ans = ans + ai

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

total = 0

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

Submission status: Runtime Error

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

print(sum)

Submission status: Runtime Error

Solution code:
input = int(input())
a = []
while(i <= input):
    if i%3 == 0 or i%5 == 0:
        pass
    else:
        a.append(i)
    i += 1

print(sum(a))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
zinput = int(input())
a = []
b = []
i = 1
while(i <= input):
  if i%3 == 0 and i%5 == 0:
    a[i] = "FizzBuzz"
  elif i%3 == 0:
    a[i] = "Fizz"
  elif i%5 == 0:
    a[i] = "Buzz"
  else:
    a[i] = "i"
  i += 1
sum = 0
for j in a:
  if a[j] != "FizzBuzz" and a[j] != "Fizz" and a[j] != "Buzz":
    sum = sum + int(a[j])
print(sum)

Submission status: Runtime Error

Solution code:
zinput = int(input())
a = []
b = []
i = 1
while(i <= input):
  if i%3 == 0 and i%5 == 0:
    a[i] = "FizzBuzz"
  elif i%3 == 0:
    a[i] = "Fizz"
  elif i%5 == 0:
    a[i] = "Buzz"
  else:
    a[i] = i
    b.append(i)
  i += 1
sum = 0
for j in a:
    sum = sum + b[j]
print(sum)

Submission status: Runtime Error

Solution code:
input = int(input())
a = []
i = 1
while(i <= input):
  if i%3 == 0 and i%5 == 0:
    a[i] = FizzBuzz
  elif i%3 == 0:
    a[i] = Fizz
  elif i%5 == 0:
    a[i] = Buzz
  else:
    a[i] = i
  i += 1
sum = 0
for j in a:
  if a[j] != "Fizz" and a[j] != "Buzz" and a[j] != "FizzBuzz":
    sum = sum + a[j]
print(sum)

Submission status: Runtime Error

Solution code:
input = int(input())
a = []
i = 1
while(i <= input):
  if i%3 == 0 and i%5 == 0:
    a[i] = FizzBuzz
  elif i%3 == 0:
    a[i] = Fizz
  elif i%5 == 0:
    a[i] = Buzz
  else:
    a[i] = i
  i += 1
sum = 0
for j in a:
  if a[i] != "Fizz" and a[i] != "Buzz" and a[i] != "FizzBuzz":
    sum = sum + a[i]
print(sum)

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())

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

print(cal)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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: Runtime Error

Solution code:
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: Runtime Error

Solution code:
(N*(N+1)/2)-(N//3*(N//3+1)/2)-(N//5*(N//5+1)/2)+(N//15*(N//15+1)/2)

Submission status: Runtime Error

Solution code:
a = 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: Runtime Error

Solution code:
n = int(input())
count = 0;

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

Submission status: Runtime Error

Solution code:
def find_sum(N):
  c = 0
  for i in range(1, N+1):
    if i % 3 != 0 and i % 5 != 0:
      c += i
  return c
 
print(find_sum(N))

Submission status: Runtime Error

Solution code:
def find_sum(N):
  c = 0
  for i in range(1, N+1):
    if i % 3 == 0 and i % 5 == 0:
      c += i
  return c
 
print(find_sum(N))

Submission status: Runtime Error

Solution code:
def find_sum(N):
  c = 0
  for i in range(1, N+1):
    if i % 3 == 0 and i % 5 == 0:
      c += i
  return c

print(find_sum(N))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input()
num = 0
accum = [1:n+1]
for x in accum:
	if (n%5!=0) or (n%3!=0):
      num += x
return num

Submission status: Runtime Error

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

A = list(range(1,N+1))
#print(A)

newlist = [i for i in A if i%3 != 0]
#print(newlist)

newlist2 = [j for j in newlist if j%5 != 0]
#print(newlist2)

s = sum(newlist2)
print(s)

Submission status: Runtime Error

Solution code:
N = map(float,input()) 
#N = 1000000

A = list(range(1,N+1))
#print(A)

newlist = [i for i in A if i%3 != 0]
#print(newlist)

newlist2 = [j for j in newlist if j%5 != 0]
#print(newlist2)

s = sum(newlist2)
print(s)

Submission status: Runtime Error

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

A = list(range(1,N+1))
print(A)

newlist = [i for i in A if i%3 != 0]
print(newlist)

newlist2 = [j for j in newlist if j%5 != 0]
print(newlist2)

s = sum(newlist2)
print(s)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
from numpy import*;print(sum(arange(int(input())+1)[i%3>0<i%5]))

Submission status: Runtime Error

Solution code:
*x,=range(int(input())+1);x[::3]=x[::5]=0;print(sum(x))

Submission status: Runtime Error

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

print (m)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
for i in N:
  if (i+1) % 3 == 0 or (i+1) % 5 == 0:
    pass
  else:
    m = i + 2

print(int(m))

Submission status: Runtime Error

Solution code:
import math

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

print(sum)

Submission status: Runtime Error

Solution code:
import  pandas as pd
N=list(range(1,int(input())+1))
df=pd.DataFrame(N,columns=["moto"])
df["3"]=df["moto"]%3
df["5"]=df["moto"]%5
print(df[(df['3']!=0) & (df['5']!=0)]["moto"].sum())

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def solve():
 
    N = int(input())
 
    ans = 0
    for i in range(N+1):
        if i % 3 == 0 and i % 5 == 0:
            pass
        elif i % 3 == 0:
            pass
        elif i % 5 == 0:
            pass
        else:
            ans += i
 
    print(ans)
 
 
if __name__ == "__main__":
    solve()
def solve():

    N = int(input())

    ans = 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:
            ans += i

    print(ans)


if __name__ == "__main__":
    solve()
提出情報

Submission status: Runtime Error

Solution code:
n=int(input())
def t(n):
    if n < 1:
        return 0
    return n + t(n - 1)
print(t(n)-3*t(n//3)-5*t(n//5)+15*t(n//15))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = 0
n = int(N)
for i in range(1,n+1):
    if i % 5 != 0 and i % 3 != 0:
        a = a + i
    else:
        continue
return(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())

for i in range(N+1):
  if(N%3 !> 0 !< N%5):
    M += i
print(M)

Submission status: Runtime Error

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: Runtime Error

Solution code:
n=input()

sum=0

for i in int(n):
  if (i%3!=0)&(i%5!=0):
    sum+=i
print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
L = [0 if x//3==0 or x//5==0 else x for x in range(1,16)]
Q = N//15
R = N%15
S = 30 * Q * (Q+1) + sum(L[R-1])
print(S)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
f=t//5
tt=t//3
ff=t//15
f=(f*(f+1)//2 )*5
tt=(tt*(tt+1)//2 )*3
ff =(ff*(ff+1)//2 )*15
print(t*(t+1)//2 - f -tt +ff)

Submission status: Runtime Error

Solution code:
n = input()
s = 0
for N in range(n+1):
    if not N%3 == 0:
        if not N%5 == 0:
            s = s+N
    return()
print(s)

Submission status: Runtime Error

Solution code:
n = input()
s = 0
for N in range(n+1):
    if N%3 == 0:
        if N%5 == 0:
            s = s+N
    return()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
 fizzBuzz = []
 inputNumber = int(input())
 for i in range(inputNumber + 1):
     if i % 3 == 0 and i % 5 == 0:
         metCondition = 'FizzBuzz'
     elif i % 5 == 0:
         metCondition = 'Buzz'
     elif i % 3 == 0:
         metCondition = 'Fizz'
     else:
         metCondition = i
     fizzBuzz.append(metCondition)
 metCondition_2 = [num for num in fizzBuzz if isinstance(num, (int, float))]
 print(sum(metCondition_2))

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

Solution code:
 = input()
Q = 0
for i in range(int(N)):
  P = []
  for j in range(len(str(i))):
    k= str(i)
    P.append(int(k[j]))
  if(sum(P)%3 == 0 and P[-1]/5 == 0):
      Q += 0
  elif(sum(P)%3 == 0):
      Q += 0
  elif(P[-1] == 0 or P[-1] == 5):
      Q += 0
  else:
      Q += i
print(Q)

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
num=int(input())
if num%15==0:
  num=num/15
  print(int(num*(num+1)*30))
if num%15==1:
  num=(num-1)/15
  print(int(num*(num+1)*30+num*15+1))
if num%15==2:
  num=(num-2)/15
  print(int(num*(num+1)*30+num*30+3))
if num%15==3:
  num=(num-3)/15
  print(int(num*(num+1)*30+num*30+3))
if num%15==4:
  num=(num-4)/15
  print(int(num*(num+1)*30+num*120+7))
if num%15==5:
  num=(num-5)/15
  print(int(num*(num+1)*30+num*120+7)
if num%15==6:
  num=(num-6)/15
  print(int(num*(num+1)*30+num*120+7))
if num%15==7:
  num=(num-7)/15
  print(int(num*(num+1)*30+num*210+14))     
if num%15==8:
  num=(num-8)/15
  print(int(num*(num+1)*30+num*240+22))     
if num%15==9:
  num=(num-9)/15
  print(int(num*(num+1)*30+num*240+22))
if num%15==10:
  num=(num-10)/15
  print(int(num*(num+1)*30+num*240+22))
if num%15==11:
  num=(num-11)/15
  print(int(num*(num+1)*30+num*330+33))
if num%15==12:
  num=(num-2)/15
  print(int(num*(num+1)*30+num*330+33))
if num%15==13:
  num=(num-13)/15
  print(int(num*(num+1)*30+num*390+46))
if num%15==14:
  num=(num-14)/15
  print(int(num*(num+1)*30+num*420+60))

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
a=0
k=n//15
a+=60*k**2
While 0==n%15:
  if not n%3==0 and not n%5==0:
    a+=n
  n-=0
print(a)

Submission status: Runtime Error

Solution code:
N=input()
i = 3
j = 5
k = 15
total3 = 0
total5 = 0
total15 = 0
while i<N:
  total3 += i
  i = i + 3
while j<N:
  total5 += j
  j = j + 5
while k<N:
  total15 += k
  k = k + 15
N_sum = (1 + N) * N / 2

ans = N_sum - i - j + k

print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
a=0
k=n//15
a+=60*k**2
While 0=n%15:
  if not n%3=0 and not n%5=0:
    a+=n
  n-=0
print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=input()
i = 3
j = 5
k = 15
total3 = 0
total5 = 0
total15 = 0
while i<=N:
  total3 += i
  i = i + 3
while j<=N:
  total5 += j
  j = j + 5
while k<=N:
  total15 += k
  k = k + 15
N_sum = (1 + N) * N / 2

ans = N_sum - i - j + k

print(ans)

Submission status: Runtime Error

Solution code:
import math
#数値ひとつ
I = int(input())
#数値欲しいとき
#H, W = map(int, input().split())
#文字欲しいとき
#N = input()
#それをListにしたいとき
#listA = list(N)
a = 0
for num in range(I):
    if num%3 == 0 and num%5 == 0:

    elif num%3 == 0:

    elif num%5 == 0:

    else:
        a = a + num

print(a)

Submission status: Runtime Error

Solution code:
N=input()
i = 3
j = 5
k = 15
total3 = 0
total5 = 0
total15 = 0
while i<=N:
  total3 += i
  i = i + 3
while j<=N:
  total5 += j
  j = j + 5
while k<=N:
  total15 += k
  k = k + 5
N_sum = (1 + N) * N / 2

ans = N_sum - i - j + k

print(ans)

Submission status: Runtime Error

Solution code:
N = input()
Q = 0
for i in range(int(N)):
  P = []
  for j in range(len(str(i))):
    k= str(j)
    P.append(int(k[j]))
  if(sum(P)%3 == 0 and P[-1] == 0 or P[-1] == 5):
    Q += 0
  elif(sum(P)%3 == 0):
    Q += 0
  elif(P[-1] == 0 or L[-1] == 5):
    Q += 0
  else:
    Q += i
print(Q)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

Solution code:

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
b = int(input())
if 7 in str(b):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
M = N + 1
ans = 0

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = long(input())
j = 0
for i in range(a):
    if i%3==0:
        continue
    if i%5==0:
        continue
    else:
        j+=i
print(j)

Submission status: Runtime Error

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

    print(total)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in n:
  m = i % 3
  if m != 0:
    m = i % 5
  else if m != 0:
    x.append(i)

print(sum(x))

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**7)
N=input()
n=list()
m=list()
for i in range(N-1):
    if(i%3==0 or i%5==0):
        n.append(i)
    else:
        m.append(i)
print(sum(m))

Submission status: Runtime Error

Solution code:
N = int(input())

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

print(ans)

Submission status: Runtime Error

Solution code:
from collections import defaultdict
def solve(rr,gg,bb):
    d1,d2=defaultdict(list),defaultdict(list)
    for i in range(len(gg)):
        ii=gg[i]
        for j in range(len(rr)):
            jj=rr[j]
            if ii>jj:
                d1[ii].append(ii-jj)
    for i in range(len(gg)):
        ii=gg[i]
        for j in range(len(bb)):
            jj=bb[j]
            if ii<jj:
                d2[ii].append(jj-ii)
    s=0
    #print(d1,d2)
    for x in d1:
        for y in d1[x]:
            for z in d2[x]:
                if y!=z:
                    s+=1
    return s
        
n=int(input())
s=input()
l=list(s)
rr,gg,bb=[],[],[]
for i in range(len(s)):
    ii=s[i]
    if ii=='R':rr.append(i)
    if ii=="G":gg.append(i)
    if ii=="B":bb.append(i)
#print(rr,gg,bb)
print(solve(rr,gg,bb)+solve(rr,bb,gg)+solve(bb,rr,gg)+solve(bb,gg,rr)+solve(gg,rr,bb)+solve(gg,bb,rr))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

s=input()
F=list((range(0,s)) - (range(0,s,3))- (range(0,s,5)))

print(sum(F))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in n:
m = i % 3
if m != 0:
  m = i % 5
  else if m != 0:
    x.append(i)

print(sum(x))