import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); BigInteger N = new BigInteger(sc.next()); String fizzbuzz = fizzBuzzString(N); int cnt = 0; for (int i = 0; i < fizzbuzz.length(); i++) { if (fizzbuzz.charAt(i) == 'z') cnt++; } System.out.println(cnt); } private static String fizzBuzzString(BigInteger n) { StringBuilder result = new StringBuilder(); for (BigInteger i = BigInteger.ONE; i.compareTo(n) <= 0; i = i.add(BigInteger.ONE)) { if (i.mod(new BigInteger("15")).compareTo(BigInteger.ZERO) == 0) { result.append("FizzBuzz"); } else if (i.mod(new BigInteger("3")).compareTo(BigInteger.ZERO) == 0) { result.append("Fizz"); } else if (i.mod(new BigInteger("5")).compareTo(BigInteger.ZERO) == 0) { result.append("Buzz"); } else { result.append(i.toString()); } } return result.toString(); } }