Arrangement of Contest | 프로그래밍의 벗 PivotOJ
PivotOJ

Arrangement of Contest

시간 제한: 2000ms메모리 제한: 256MB출처: NEERC Northern Subregional 2013BOJ 9443

문제

Little Dmitry and little Petr want to arrange a contest. Their little friends submitted several task proposals and now Dmitry and Petr want to select some of them for the contest. As they are just little boys, they cannot estimate quality of tasks, but they know for sure that in good contest title of the first problem starts with A, the title of the second one — with B, and so on.

Given titles of the proposed tasks, help little brothers to determine the maximal number of problems in a good contest they can arrange.

입력

The first line contains single integer n — the number of problem proposals received by the little brothers (1 ≤ n ≤ 100).

Next n lines contain titles of proposed problems, one per line. The length of each title does not exceed 30 characters. Each title starts with an uppercase letter and contains only English letters, digits and underscores.

출력

Output a single number — the maximal number of problems in a good contest. In case there is no good contest that may be arranged, output 0.

예제

예제 1

입력
12
Arrangement_of_Contest
Ballot_Analyzing_Device
Correcting_Curiosity
Dwarf_Tower
Energy_Tycoon
Flight_Boarding_Optimization
Garage
Heavy_Chain_Clusterization
Intellectual_Property
J
Kids_in_a_Friendly_Class
Lonely_Mountain
출력
12

예제 2

입력
3
Snow_White_and_the_7_Dwarfs
A_Problem
Another_Problem
출력
1

예제 3

입력
2
Good_Problem
Better_Problem
출력
0
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.