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

public class MAIN{

    private static BufferedReader reader = null;
    private static BufferedWriter writer = null;

    public static void main(String[] args) throws Exception{

        reader = new BufferedReader(new InputStreamReader(System.in));

        String[] s = reader.readLine().split(" ");
        int n = Integer.parseInt(s[0]);

        Map<String, Integer> alcMap = new HashMap<>(0);
        alcMap.put("ABSINTH",1);
        alcMap.put("BEER",1);
        alcMap.put("BRANDY",1);
        alcMap.put("CHAMPAGNE",1);
        alcMap.put("GIN",1);
        alcMap.put("RUM",1);
        alcMap.put("SAKE",1);
        alcMap.put("TEQUILA",1);
        alcMap.put("VODKA",1);
        alcMap.put("WHISKEY",1);
        alcMap.put("WINE",1);

        int count = 0;
        for(int i=0;i<n;++i){
            String d = reader.readLine();
            try{
                if(Integer.parseInt(d) < 18){
                    ++count;
                }
            } catch (NumberFormatException e){
                count += (alcMap.get(d) != null) ? 1 : 0;
            }
        }

        System.out.println(count);

    }

    private static class IntIntPair{
        int first;
        int second;
        public IntIntPair(int first, int second) {
            this.first = first;
            this.second = second;
        }
        public IntIntPair getInversePair(){
            return new IntIntPair(
                    this.second,
                    this.first
            );
        }
        public boolean equals(IntIntPair p){
            return p.first == this.first && p.second == this.second;
        }
    }
    private static class StringStringPair{
        String first;
        String second;
        public StringStringPair(String first, String second) {
            this.first = first;
            this.second = second;
        }
        public StringStringPair getInversePair(){
            return new StringStringPair(
                    this.second,
                    this.first
            );
        }
        public boolean equals(StringStringPair p){
            return p.first.equals(this.first) && p.second.equals(this.second);
        }
    }
    private static class StringIntPair{
        String first;
        int second;
        public StringIntPair(String first, int second) {
            this.first = first;
            this.second = second;
        }
        public boolean equals(StringIntPair p){
            return p.first.equals(this.first) && p.second == this.second;
        }
    }

    private static List<List<Integer>> getCombinations(int[] a, int count){
        List<List<Integer>> ret = new ArrayList<>(0);
        if(a == null || a.length > 64 || count <= 0 || count > a.length){
            return null;
        } else {
            long lim = (1L<<a.length);
            for(long i=0;i<lim;++i){
                List<Integer> poss = getBitPositionList(i);
                if(poss.size() == count){
                    List<Integer> list = new ArrayList<>(0);
                    for(int j=0;j< poss.size();++j){
                        list.add(a[poss.get(j)]);
                    }
                    ret.add(list);
                }
            }
        }
        return ret;

    }

    private static int getBitCount(long n){
        int onCount = 0;
        for(long i=0L;i<64L;++i){
            if((n&(1L<<i)) != 0){
                ++onCount;
            }
        }
        return onCount;
    }
    private static List<Integer> getBitPositionList(long n){
        List<Integer> idxs = new ArrayList<>(0);
        for(long i=0L;i<64L;++i){
            if((n&(1L<<i)) != 0){
                idxs.add(((int) i));
            }
        }
        return idxs;
    }
    private static IntIntPair getIrreducibleFraction(int x, int y){
        int min = (x <= y) ? x : y;
        for(int i=2; i<=min; ++i){
            while (x%i==0 && y%i==0){
                x = x/i;
                y = y/i;
            }
        }
        return new IntIntPair(x,y);
    }

    private static int getDigitSumInBase(int n, int b){
        int sum = 0;
        while (true){
            sum += n%b;
            n = n/b;
            if(n==0){
                break;
            }
        }
        return sum;
    }

    private static List<Integer> getSegmentedPrimes(int start, int end){

        List<Integer> ret = new ArrayList<>(0);
        List<Integer> primes = getPrimes(((int) Math.ceil(Math.sqrt(end))));

        boolean[] flags = new boolean[(end-start+1)+1];
        for(int i=0; i< flags.length; ++i){
            flags[i] = true;
        }
        for(int i=0;i< primes.size();++i){
            int lLim = (start / primes.get(i)) * primes.get(i);
            while (lLim< start) {
                lLim += primes.get(i);
            }
            for (int j = lLim; j <= end; j += primes.get(i)){
                flags[j- start] = false;
            }
        }
        for(int i = start; i<= end; ++i){
            if(flags[i- start]){
                ret.add(i);
            }
        }

        return ret;

    }
    private static List<Integer> getPrimes(int n){

        List<Integer> primes = new ArrayList<>(0);

        boolean[] flags = new boolean[n+1];
        for(int i=0; i<flags.length; ++i){
            flags[i] = true;
        }
        flags[0] = false;
        flags[1] = false;

        for(int i=2;i*i<=n;++i){
            if(flags[i]){
                for(int j = i*i; j <= n; j += i){
                    flags[j] = false;
                }
            }
        }

        for(int i=0, len = n+1; i < len; ++i){
            if(flags[i]){
                primes.add(i);
            }
        }

        return primes;
    }
    private static boolean isPrime(int n){
        if(n<=1){
            return false;
        } else if(n==2){
            return true;
        } else {
            for(int i=2;i<n;++i){
                if(n%i == 0){
                    return false;
                }
            }
        }
        return true;
    }

    private static void displayArray(int[] A, String header){
        System.out.println(header);
        for (int i=0;i<A.length; ++i){
            System.out.println(A[i]);
        }
    }
    private static void displayList(List<Integer> L, String header){
        System.out.println(header);
        for (int i=0;i<L.size(); ++i){
            System.out.println(L.get(i));
        }
    }

    private static void swap(boolean[] arr, int i1, int i2){
        boolean tmp = arr[i1];
        arr[i1] = arr[i2];
        arr[i2] = tmp;
    }

    private static int getMaxIndex(int[] a){
        int MAX = Integer.MIN_VALUE;
        int ret = 0;
        for(int i=0;i<a.length;++i){
            if(a[i] >= MAX){
                MAX = a[i];
                ret = i;
            }
        }
        return ret;
    }
    private static int getSum(int[] a){
        int sum = 0;
        for(int i=0; i<a.length;++i){
            sum += a[i];
        }
        return sum;
    }

}