#include <bits/stdc++.h>
using namespace std;
map<string, int> ale;
int n;
void getAle() {
  ale["ABSINTH"] = 1;
  ale["BEER"] = 1;
  ale["BRANDY"] = 1;
  ale["CHAMPAGNE"] = 1;
  ale["GIN"] = 1;
  ale["RUM"] = 1;
  ale["SAKE"] = 1;
  ale["TEQUILA"] = 1;
  ale["VODKA"] = 1;
  ale["WHISKEY"] = 1;
  ale["WINE"] = 1;
}
int isWine(string s) {
  if (ale[s] == 1) return 1;
  return 0;
}
int main() {
  cin >> n;
  getAle();
  int k = 0;
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    if (isWine(s)) {
      k++;
    }
    if (s.length() == 1 && (s[0] >= '0' && s[0] <= '9')) {
      k++;
    }
    if (s.length() == 2 && s[0] == '1' && (s[1] >= '0' && s[1] <= '7')) {
      k++;
    }
  }
  cout << k << endl;
  return 0;
}
