import java.util.Scanner; public class Fizzbuzz { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int threeAndFive = koubaisuu(5, 3); StringBuilder sb = new StringBuilder(); for (int i = 1; i <= N; i++) { if (i % threeAndFive == 0) { sb.append("FizzBuzz"); } else if (i % 3 == 0) { sb.append("Fizz"); } else if (i % 5 == 0) { sb.append("Buzz"); } } int count = 0; for (int i = 0; i < sb.length(); i++) { if (sb.charAt(i) == 'z') { count++; } } System.out.println(count); } // 最大公約数もとめてれる private static int saidai(int a, int b) { int r; while ((r = a % b) != 0) { a = b; b = r; } return b; } //最小公倍数 private static int koubaisuu(int a ,int b) { int gcd = getGCD(a, b); return a * b /gcd; } //最大公倍数 private static int getGCD(int m, int n) { return n == 0 ? m : getGCD(n, m % n); } }