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