#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cont = 0;
  scanf("%d", &n);
  while (n--) {
    string str;
    cin >> str;
    int sz = str.size();
    if (sz == 1 && str >= "0" && str <= "9")
      cont++;
    else if (sz == 2 && str[0] == '1' && str[1] >= '0' && str[1] < '8')
      cont++;
    else if (str == "ABSINTH" || str == "BEER" || str == "BRANDY" ||
             str == "CHAMPAGNE" || str == "GIN" || str == "RUM" ||
             str == "SAKE" || str == "TEQUILA" || str == "VODKA" ||
             str == "WHISKEY" || str == "WINE")
      cont++;
  }
  printf("%d\n", cont);
  return 0;
}
