N=int(eval(input()))



count=0

for i in range(N+1):

    if i %15==0:

        i="FizzBuzz"

    elif i%3==0:

        i="Fizz"

    elif i%5==0:

        i="Buzz"

    else:

        count+=i

print(count)
N=int(eval(input()))

sum=0

for i in range(N+1):

    if i%3==0 or i%5==0:

        sum+=0

    else:

        sum+=i

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

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

-count = 0 +sum = 0 -    if i % 15 == 0: -        i = "FizzBuzz" -    elif i % 3 == 0: -        i = "Fizz" -    elif i % 5 == 0: -        i = "Buzz" +    if i % 3 == 0 or i % 5 == 0: +        sum += 0 -        count += i -print(count) +        sum += i +print(sum)