codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

56A.md (1557B)


      1 Source: https://codeforces.com/problemset/problem/56/A
      2 
      3 A. Bar
      4 
      5 time limit per test
      6 
      7 2 seconds
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 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?
     22 
     23 The list of all alcohol drinks in Berland is: ABSINTH, BEER, BRANDY, CHAMPAGNE, GIN, RUM, SAKE, TEQUILA, VODKA, WHISKEY, WINE
     24 
     25 Input
     26 
     27 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.
     28 
     29 Only the drinks from the list given above should be considered alcohol.
     30 
     31 Output
     32 
     33 Print a single number which is the number of people Vasya should check to guarantee the law enforcement.
     34 
     35 Examples
     36 
     37 Input
     38 
     39 ```
     40 5  
     41 18  
     42 VODKA  
     43 COKE  
     44 19  
     45 17
     46 ```
     47 
     48 Output
     49 
     50 ```
     51 2
     52 ```
     53 
     54 Note
     55 
     56 In the sample test the second and fifth clients should be checked.