#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, fau = 0, numm = 0;
  string s;
  int num(string s);
  cin >> n;
  string a[11] = {"ABSINTH", "BEER",    "BRANDY", "CHAMPAGNE", "GIN", "RUM",
                  "SAKE",    "TEQUILA", "VODKA",  "WHISKEY",   "WINE"};
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s[0] >= '0' && s[0] <= '9') {
      numm = num(s);
      if (numm < 18) fau++;
    } else
      for (int k = 0; k < 11; k++)
        if (a[k] == s) {
          fau++;
          break;
        }
  }
  cout << fau;
}
int num(string s) {
  int f = s.length() - 1;
  int sum = 0;
  for (int i = f; i >= 0; i--) sum += (s[i] - 48) * pow(10, f - i);
  return sum;
}
