inp = int(input()) n = int(input()) a = n//15 b = n%15 ls = [i for i in range(1, b+1)] #print(ls) als = [] for i in ls: if i % 15 == 0: als.append('FizzBuzz') elif i % 5 == 0: als.append('Buzz') elif i % 3 == 0: als.append('Fizz') else: als.append(str(i)) #print(als) ans = "".join(als) c = ans.count('z') print(a*16 + c)