import java.util.*; public class Main { public static void main(String[] args) { // 標準入力を受け取る Scanner sc = new Scanner(System.in); Long n = sc.nextLong(); String result = ""; // 変換ループ for(long l = 1; l <= n; l++) { if(l % 15 == 0) { result = result + "FizzBuzz"; }else if(l % 3 == 0) { result = result + "Fizz"; }else if(l % 5 == 0) { result = result + "Buzz"; }else { result = result + l; } } // カウントループ int count = 0; for(int l = 0; l < result.length(); l++) { if(result.charAt(l) == 'z'){ count++; } } System.out.println(count); } }