#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n, l = 0, r = 0, k, ans = 0, lox = 0;
  string s;
  string blist[12] = {"ABSINTH", "BEER",    "BRANDY", "CHAMPAGNE", "GIN", "RUM",
                      "SAKE",    "TEQUILA", "VODKA",  "WHISKEY",   "WINE"};
  cin >> t;
  while (t--) {
    cin >> s;
    if ((s.size() == 1 && s[0] >= '0' && s[0] <= '9') ||
        (s.size() == 2 && s[1] >= '0' && s[1] <= '7' && s[0] == '1'))
      lox++;
    else {
      for (int i = 0; i < 12; i++)
        if (blist[i] == s) ans++;
    }
    if (ans > 0) lox++;
    ans = 0;
  }
  cout << lox;
  return 0;
}
