#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i = 1, flag = 0, count = 0, y;
  cin >> n;
  string x, arr[] = {"ABSINTH", "BEER",    "BRANDY", "CHAMPAGNE", "GIN", "RUM",
                     "SAKE",    "TEQUILA", "VODKA",  "WHISKEY",   "WINE"};
  vector<string> s(arr, arr + 11);
  for (int i = 0; i < n; i++) {
    cin >> x;
    y = x.length();
    if ((y == 1 && x[0] >= 48 && x[0] <= 57) ||
        (y == 2 && x[0] == 49 && x[1] <= 55)) {
      count++;
    }
    if (x[0] >= 65 && find(s.begin(), s.end(), x) != s.end()) {
      count++;
    }
  }
  cout << count;
}
