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