#include <bits/stdc++.h>
using namespace std;
set<string> alcohol;
int n;
int main() {
  alcohol.insert("ABSINTH");
  alcohol.insert("BEER");
  alcohol.insert("BRANDY");
  alcohol.insert("CHAMPAGNE");
  alcohol.insert("GIN");
  alcohol.insert("RUM");
  alcohol.insert("SAKE");
  alcohol.insert("TEQUILA");
  alcohol.insert("VODKA");
  alcohol.insert("WHISKEY");
  alcohol.insert("WINE");
  cin >> n;
  int ans = 0;
  for (unsigned j = 0; j < n; j++) {
    string s;
    cin >> s;
    if (alcohol.find(s) == alcohol.end()) {
      bool num = true;
      for (unsigned i = 0; i < s.length(); i++) {
        if (s[i] < '0' || s[i] > '9') {
          num = false;
          break;
        }
      }
      if (num) {
        int g = atoi(s.c_str());
        if (g < 18) ans++;
      }
    } else {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
