#include <bits/stdc++.h>
using namespace std;
string qw(int a) {
  int i;
  string x;
  if (a == 0)
    x = "0";
  else {
    while (a > 0) {
      x += (a % 10) + '0';
      a /= 10;
    }
  }
  reverse(x.begin(), x.end());
  return x;
}
int main() {
  int i, n, ans = 0;
  string take,
      z[11] = {"ABSINTH", "BEER",    "BRANDY", "CHAMPAGNE", "GIN", "RUM",
               "SAKE",    "TEQUILA", "VODKA",  "WHISKEY",   "WINE"};
  vector<string> v;
  for (i = 0; i < 18; i++) {
    v.push_back(qw(i));
  }
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> take;
    for (int j = 0; j < 11; j++) {
      if (take == z[j]) ans++;
    }
    for (int j = 0; j < v.size(); j++) {
      if (take == v[j]) ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
