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) input = input() split_input = input.split() number = int(split_input[0]) if (1 <= number and number <= 10 ** 18): text = getFizzBuzzString(number) print(text.count('z'))