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