#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[99999];
  int n, sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (atoi(a) < 18 && '0' <= a[0] && a[0] <= '9') sum++;
    if (strcmp(a, "ABSINTH") == 0) sum++;
    if (strcmp(a, "BEER") == 0) sum++;
    if (strcmp(a, "BRANDY") == 0) sum++;
    if (strcmp(a, "CHAMPAGNE") == 0) sum++;
    if (strcmp(a, "GIN") == 0) sum++;
    if (strcmp(a, "RUM") == 0) sum++;
    if (strcmp(a, "SAKE") == 0) sum++;
    if (strcmp(a, "TEQUILA") == 0) sum++;
    if (strcmp(a, "VODKA") == 0) sum++;
    if (strcmp(a, "WHISKEY") == 0) sum++;
    if (strcmp(a, "WINE") == 0) sum++;
  }
  cout << sum << endl;
  return 0;
}
