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.*;
import java.math.*;
import java.util.*;

/**
* 
* @author Togrul Gasimov (ttogrul30@gmail.com)
*         Created on 13.09.2013
*/

public class Main {
public static void main(String[] args) /*throws FileNotFoundException*/ { 
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    FastScanner in = new FastScanner(inputStream);
    FastPrinter out = new FastPrinter(outputStream);
    TaskA solver = new TaskA();
    solver.solve(1, in, out);
    out.close();
}
}

class TaskA{
  
public void solve(int testNumber, FastScanner scan, FastPrinter out) /*throws FileNotFoundException*/ {
    //Scanner sscan = new Scanner(new File("input.txt"));
    //PrintStream oout = new PrintStream(new File("output.txt"));
	int n = scan.nextInt(), ans = 0;
	String[] a = {"ABSINTH", "BEER", "BRANDY", "CHAMPAGNE", "GIN", "RUM", "SAKE", "TEQUILA", "VODKA", "WHISKEY", "WINE"};
	for(int i = 1; i <= n; i++){
		String s = scan.next();
		try{
		int x = Integer.parseInt(s);
		if(x < 18)ans++;
		}catch(Exception e){
			for(int j = 0; j <= 10; j++){
				if(s.equals(a[j])){
					ans++; break;
				}
			}
		}
	}
	out.println(ans);
    //sscan.close();
    //oout.close();
}
}

class FastScanner extends BufferedReader {
public FastScanner(InputStream is) {
    super(new InputStreamReader(is));
}

public int read() {
    try{
        int ret = super.read();
        return ret;
    }catch(Exception e){
        throw new InputMismatchException();
    }
}

public String next() {
    StringBuilder sb = new StringBuilder();
    int c = read();
    while (isWhiteSpace(c)) {
        c = read();
    }
    if (c < 0) {
        return null;
    }
    while (c >= 0 && !isWhiteSpace(c)) {
        sb.appendCodePoint(c);
        c = read();
    }
    return sb.toString();
}

static boolean isWhiteSpace(int c) {
    return c >= 0 && c <= 32;
}

public int nextInt() {
    int c = read();
    while (isWhiteSpace(c)) {
        c = read();
    }
    int sgn = 1;
    if (c == '-') {
        sgn = -1;
        c = read();
    }
    int ret = 0;
    while (c >= 0 && !isWhiteSpace(c)) {
        if (c < '0' || c > '9') {
            throw new NumberFormatException("digit expected " + (char) c
                    + " found");
        }
        ret = ret * 10 + c - '0';
        c = read();
    }
    return ret * sgn;
}

public long nextLong() {
    return Long.parseLong(next());
}

public double nextDouble() {
    return Double.parseDouble(next());
}

public BigInteger nextBigInteger() {
    return new BigInteger(next());
}

public BigDecimal nextBigDecimal(){
    return new BigDecimal(next());
}

public String readLine(){
    try{
        return super.readLine();
    }catch(IOException e){
        return null;
    }
}
}

class FastPrinter extends PrintWriter {

public FastPrinter(OutputStream out) {
    super(out);
}
public FastPrinter(Writer out) {
    super(out);
}
}