#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int count = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string a;
    cin >> a;
    if (a == "ABSINTH" || a == "BEER" || a == "BRANDY" || a == "CHAMPAGNE" ||
        a == "GIN" || a == "RUM" || a == "SAKE" || a == "TEQUILA" ||
        a == "VODKA" || a == "WHISKEY" || a == "WINE" || a == "0" || a == "1" ||
        a == "2" || a == "3" || a == "4" || a == "5" || a == "6" || a == "7" ||
        a == "8" || a == "9" || a == "10" || a == "11" || a == "12" ||
        a == "13" || a == "14" || a == "15" || a == "16" || a == "17")
      count++;
  }
  cout << count;
  return 0;
}
