#include <bits/stdc++.h>
using namespace std;
int main() {
  string arr[11] = {"ABSINTH", "BEER",    "BRANDY", "CHAMPAGNE", "GIN", "RUM",
                    "SAKE",    "TEQUILA", "VODKA",  "WHISKEY",   "WINE"};
  int n;
  cin >> n;
  int counter = 0;
  string str;
  int num_convert;
  for (int i = 0; i < n; i++) {
    str = "";
    cin >> str;
    if (isdigit(str.at(0))) {
      num_convert = stoi(str, nullptr, 10);
      if (num_convert < 18) {
        counter++;
      }
    } else {
      for (int i = 0; i < 11; i++) {
        if (str == arr[i]) {
          counter++;
        }
      }
    }
  }
  cout << counter;
}
