package yukicoder; import java.util.ArrayList; import java.util.Scanner; public class Yuki311 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int num = scan.nextInt(); scan.close(); int ans = 0; ArrayList arrayList = new ArrayList(); for (int i = 0; i < num; i++ ) { if( i%3 == 0 && i%5 == 0 ){ arrayList.add("FizzBuzz"); } else if ( i%3 == 0 ) { arrayList.add("Fizz"); } else if ( i%5 == 0 ) { arrayList.add("Buzz"); } else { } } for(String char_z : arrayList ) { for(int i = 0; i < char_z.length(); i++){ if('z' == char_z.charAt(i)){ ans++; } } } System.out.println(ans); } }