#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int count = 0;
  for (int i = 0; i < n; i++) {
    string str;
    cin >> str;
    if (str[0] - '0' > 10) {
      if (str == "BEER" || str == "WHISKEY" || str == "VODKA" || str == "GIN" ||
          str == "TEQUILA" || str == "ABSINTH" || str == "BRANDY" ||
          str == "RUM" || str == "SAKE" || str == "WINE" ||
          str == "CHAMPAGNE") {
        count += 1;
      }
    } else {
      if (stoi(str) < 18) {
        count += 1;
      }
    }
  }
  cout << count << endl;
  return 0;
}
