logo AlgoBeat OnlineJudge
登录 注册

#206223. [NWRRC 2013] Arrangement of Contest

内存限制:256 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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 , 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 -- the number of problem proposals received by the little brothers .

Next lines contain titles of proposed problems, one per line. The length of each title does not exceed 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 .

样例

样例输入 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

样例输出 1

12

样例输入 2

3
Snow_White_and_the_7_Dwarfs
A_Problem
Another_Problem

样例输出 2

1

样例输入 3

2
Good_Problem
Better_Problem

样例输出 3

0

数据范围与提示

Time limit: 2 s, Memory limit: 256 MB.