#include <bits/stdc++.h>
using namespace std;
bool isnumber(string a) {
  for (int i = 0; i < a.length(); i++) {
    if (isdigit(a[i]) == false) {
      return false;
    }
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  int count = 0;
  while (t--) {
    string a;
    cin >> a;
    string g[11] = {"ABSINTH", "BEER",    "BRANDY", "CHAMPAGNE", "GIN", "RUM",
                    "SAKE",    "TEQUILA", "VODKA",  "WHISKEY",   "WINE"};
    if (isnumber(a)) {
      stringstream geek(a);
      int j = 0;
      geek >> j;
      if (j < 18) {
        count++;
      }
    } else {
      for (int u = 0; u < 11; u++) {
        if (g[u] == a) {
          count++;
        }
      }
    }
  }
  cout << count << endl;
  return 0;
}
