#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long SIZE = 100000;
const int INF = 0x3f3f3f3f;
const long long ll_INF = 0x3f3f3f3f3f3f3f3f;
const long double PI = acos(-1);
const long long MAXN = numeric_limits<long long>::max();
const long long MAX = 2000000;
void disp(vector<long long> v) {
  for (auto u : v) cout << u << " ";
  cout << '\n';
}
void solve() {
  string s[]{"ABSINTH", "BEER",    "BRANDY", "CHAMPAGNE", "GIN",  "RUM",
             "SAKE",    "TEQUILA", "VODKA",  "WHISKEY",   "WINE", "0",
             "1",       "2",       "3",      "4",         "5",    "6",
             "7",       "8",       "9",      "10",        "11",   "12",
             "13",      "14",      "15",     "16",        "17"};
  int n, x = 0;
  cin >> n;
  string s1;
  for (long long i = 0; i < n; i++) {
    cin >> s1;
    for (long long i = 0; i < 29; i++) {
      if (s1 == s[i]) {
        x++;
        break;
      }
    }
  }
  cout << x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
