#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s[] = {"ABSINTH", "BEER",    "BRANDY", "CHAMPAGNE", "GIN", "RUM",
                "SAKE",    "TEQUILA", "VODKA",  "WHISKEY",   "WINE"};
  while (cin >> n) {
    string str;
    int check = 0;
    for (int i = 0; i < n; i++) {
      cin >> str;
      for (int i = 0; i < 11; i++)
        if (str == s[i]) ++check;
      if (isdigit(str[0])) {
        int x;
        stringstream ss;
        ss << str;
        ss >> x;
        if (x < 18) ++check;
      }
    }
    cout << check << endl;
  }
}
