#include <bits/stdc++.h>
using namespace std;
int main (){
  int n;
  cin >> n;
  int mas [n+1];
  int c = 0;
  
  for (int i = 1; i <n ; i++) {
    cin >> mas[i];
    if(mas[i] % 3 == 0 ) {
      i = "FIZZ"; }
    if (mas[i] % 5 == 0) {
      i = "BUZZ; }
        if (mas[i] % 5 == 0 && mas[i] % 3 == 0 ) {
          i ="FIZZBUZZ";
        }
      else {
        i = mas[i];
      } c++; } 
    cout << c; }