Elevators

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Whenever a new building is built, it must comply with all the relevant building regulations. In particular, there are rules governing the number of elevators a building must have depending on its number of floors and zoning district.

If a building has only one floor, it doesn't need any elevators; otherwise, it needs more elevators the more floors it has, and the exact number depends on its zoning district. The following tables describe the number of elevators necessary for a building in each of the residential, commercial, and industrial zoning districts.

ResidentialCommercialIndustrial
FloorsElevatorsFloorsElevatorsFloorsElevators
110011001100
252-511272-711242-411
6106-10228148-1422585-822
111511-1533152015-20339129-1233
162016-2044  131613-1644
    172017-2055

Table 1: Elevator requirements by zone

You are given the zoning district of a new building and how many floors it has. How many elevators does it need?

입력

The only line of input contains a string representing the zoning district of the building ("residential", "commercial", or "industrial"), followed by a space and an integer NN (1N201 \leq N \leq 20), the number of floors the building has.

출력

Output a single integer: the number of elevators the building must have.