According to Berland laws it is only allowed to sell alcohol to people not younger than 18 years. Vasya's job is to monitor the law's enforcement. Tonight he entered a bar and saw n people sitting there. For every one of them Vasya happened to determine either the age or the drink the person is having. Vasya can check any person, i.e. learn his age and the drink he is having at the same time. What minimal number of people should Vasya check additionally to make sure that there are no clients under 18 having alcohol drinks?

The list of all alcohol drinks in Berland is: ABSINTH, BEER, BRANDY, CHAMPAGNE, GIN, RUM, SAKE, TEQUILA, VODKA, WHISKEY, WINE

Input

The first line contains an integer n (1 ≤ n ≤ 100) which is the number of the bar's clients. Then follow n lines, each describing one visitor. A line either contains his age (an integer from 0 to 1000) or his drink (a string of capital Latin letters from 1 to 100 in length). It is guaranteed that the input data does not contain spaces and other unnecessary separators.

Only the drinks from the list given above should be considered alcohol.

Output

Print a single number which is the number of people Vasya should check to guarantee the law enforcement.

Examples

Input

5
18
VODKA
COKE
19
17


Output

2

Note

In the sample test the second and fifth clients should be checked.

import java.io.BufferedReader;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.*;

public class A50 {

	static boolean test = false; // System.getProperty("JENS_TURBO") != null;	
	
	private void solve() throws Throwable, IOException {
	
		String[] li = new String[]{"ABSINTH", "BEER", "BRANDY", "CHAMPAGNE", "GIN", "RUM", "SAKE", "TEQUILA", "VODKA", "WHISKEY", "WINE"};
		
		int n = in();
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			String str = str();
			
			if(str.charAt(0) >= '0' && str.charAt(0) <= '9'){
				int parseInt = Integer.parseInt(str);
				if(parseInt < 18){
					cnt ++;
				}
			} else {
				for (int j = 0; j < li.length; j++) {
					if(str.compareTo(li[j]) == 0){
						cnt ++;
					}
				}
			}
		}
		
		System.out.println(cnt);	
	}
	
	public String str() throws IOException {
		if (test) {
			return reader.readLine();
		} else {
			return in.readLine();
		}
	}

	private int in() throws NumberFormatException, IOException {
		return Integer.valueOf(str());
	}
	
	private long lon() throws NumberFormatException, IOException {
		return Long.valueOf(str());
	}

	private int[] ints() throws Throwable {
		StringTokenizer st = new StringTokenizer(str());
		
		int[] res = new int[st.countTokens()];
		for (int i = 0; i < res.length; i++) {
			res[i] = Integer.parseInt(st.nextToken());
		}
		return res;
	}
	
	private long[] longs() throws Throwable {
		StringTokenizer st = new StringTokenizer(str());
		
		long[] res = new long[st.countTokens()];
		for (int i = 0; i < res.length; i++) {
			res[i] = Long.parseLong(st.nextToken());
		}
		return res;
	}

	private BigInteger[] bigs() throws Throwable {
		StringTokenizer st = new StringTokenizer(str());
		
		BigInteger[] res = new BigInteger[st.countTokens()];
		for (int i = 0; i < res.length; i++) {
			res[i] = new BigInteger(st.nextToken());
		}
		return res;
	}


	public static void main(String[] args) throws Throwable {
		new A50().solve();
	}

	public A50() throws Throwable {
		if (test) {
			reader = new BufferedReader(new FileReader(new File(testDataFile)));
		}
	}

	static InputStreamReader inp = new InputStreamReader(System.in);
	static BufferedReader in = new BufferedReader(inp);
	
	static PrintWriter writer = new PrintWriter(System.out);
	static String testDataFile = "testdata.txt";
	BufferedReader reader = null;


	private double d(int row, int col, int y, int x) {
		double val = Math.pow(row - y, 2) + Math.pow(col - x, 2);
		return Math.sqrt(val);
	}
}