#include <bits/stdc++.h>
using namespace std;
long long n, k;
string s;
vector<string> v, g;
set<long long> st;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    v.push_back(s);
  }
  for (int i = 0; i < n; i++) {
    if (v[i] == "ABSINTH" or v[i] == "BEER" or v[i] == "BRANDY" or
        v[i] == "CHAMPAGNE" or v[i] == "GIN" or v[i] == "RUM" or
        v[i] == "SAKE" or v[i] == "TEQUILA" or v[i] == "VODKA" or
        v[i] == "WHISKEY" or v[i] == "WINE" or v[i] == "0" or v[i] == "1" or
        v[i] == "2" or v[i] == "3" or v[i] == "4" or v[i] == "5" or
        v[i] == "6" or v[i] == "7" or v[i] == "8" or v[i] == "9" or
        v[i] == "10" or v[i] == "11" or v[i] == "12" or v[i] == "13" or
        v[i] == "14" or v[i] == "15" or v[i] == "16" or v[i] == "17")
      k++;
  }
  cout << k;
}
