def getFizzBuzzString(num): arr = [] for i in range(num): cur = i + 1 if ((cur % 15) == 0): arr.append('FizzBuzz') elif ((cur % 5) == 0): arr.append('Buzz') elif ((cur % 3) == 0): arr.append('Fizz') else: arr.append(str(i)) return ''.join(arr) def count(text): count = 0 for w in text: if w == 'z': count = count + 1 return count input = input() split_input = input.split() number = int(split_input[0]) if (1 <= number and number <= 10 ** 18): text = getFizzBuzzString(number) print(count(text))