#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c = 0;
  char s[1000];
  cin >> n;
  while (n--) {
    cin >> s;
    if (isdigit(s[0]) && atoi(s) < 18)
      c++;
    else if (strcmp(s, "ABSINTH") == 0 || strcmp(s, "BEER") == 0 ||
             strcmp(s, "BRANDY") == 0 || strcmp(s, "CHAMPAGNE") == 0 ||
             strcmp(s, "GIN") == 0 || strcmp(s, "RUM") == 0 ||
             strcmp(s, "SAKE") == 0 || strcmp(s, "TEQUILA") == 0 ||
             strcmp(s, "VODKA") == 0 || strcmp(s, "WHISKEY") == 0 ||
             strcmp(s, "WINE") == 0)
      c++;
  }
  cout << c << "\n";
  return 0;
}
