#include <bits/stdc++.h>
using namespace std;
int n, ans;
string s[200];
string d[20] = {"ABSINTH", "BEER",    "BRANDY", "CHAMPAGNE", "GIN", "RUM",
                "SAKE",    "TEQUILA", "VODKA",  "WHISKEY",   "WINE"};
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    int a = (int)s[i][0] - 48;
    if (a <= 9 && a >= 0) {
      for (int j = 1; j < s[i].length(); j++) {
        int b = (int)s[i][j] - 48;
        a = (a * 10) + b;
      }
      if (a < 18) ans++;
    } else {
      for (int j = 0; j <= 10; j++)
        if (s[i] == d[j]) ans++;
    }
  }
  cout << ans;
  return 0;
}
