Թաքցված խնդիր
|Այս խնդիրը թաքցված է խմբագրական խրհրդի անդամի կողմից քանի որ կամ այն ոչ ճիշտ լեզվով է գրված,|կամ թեստային տվյալներն են սխալ, կամ խնդրի ձևակերպումը պարզ չէ։|

ACM_0007 - ARRANGEMENT OF CONTEST

  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.

Input

  The first line contains single integer n—the number of problem proposals received by the little brothers (1n100). 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

  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.

Examples

stdin

stdout

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


Ավելացրեց.Հրանտ Հովհաննիսյան
Ամսաթիվ.2013-12-04
Ժամանակի սահմանափակումը.1s
Ծրագրի տեքստի սահմանափակումը.50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Լեզուներ.Բոլորը բացի ASM32 ASM64 GAWK CLPS CLOJURE D ERL FSHARP FORTRAN GOSU HASK ICON ICK NEM NIM OBJC-CLANG PICO PIKE PYPY PYPY3 PY_NBC RUST SCM guile CHICKEN SED TCL WHITESPACE
Աղբյուրը.Northern QF 2013.A

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.