#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, age, c = 0;
  string s;
  cin >> n;
  while (n--) {
    cin >> s;
    if (s == "ABSINTH" || s == "BEER" || s == "BRANDY" || s == "CHAMPAGNE" ||
        s == "GIN" || s == "RUM" || s == "SAKE" || s == "TEQUILA" ||
        s == "VODKA" || s == "WHISKEY" || s == "WINE")
      c = c + 1;
    else {
      if (s.length() == 1 && s[0] <= '9') c = c + 1;
      if (s.length() == 2 && s[0] == '1' && s[1] < '8') c = c + 1;
    }
  }
  cout << c;
  return 0;
}
