#include <bits/stdc++.h>
using namespace std;
string a[12] = {"ABSINTH", "BEER",    "BRANDY", "CHAMPAGNE", "GIN", "RUM",
                "SAKE",    "TEQUILA", "VODKA",  "WHISKEY",   "WINE"};
string s;
int kol;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s[0] >= '0' && s[0] <= '9') {
      if (s.size() == 1) kol++;
      if (s.size() == 2 && (s[0] == '1' && s[1] < '8')) kol++;
    } else
      for (int j = 0; j < 11; j++)
        if (a[j] == s) {
          kol++;
          break;
        }
  }
  cout << kol;
  return 0;
}
