TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

A printable version of this contest can be found here.

What is the thing that...



AFGHANISTAN has it, but not TAJIKISTAN;

STUDENT has it, but not TEACHER;

FIRST has it, but not SECOND;

DEFENSE has it, but not ATTACK;

HIJACKING has it, but not ROBBERY;

NOPE has it, but not HOPE.


So, what is it at all? The answer is in the sample I/O.


Given a word that is only composed of upper-case letters, please determine the length of the longest consecutive increasing letter string. A line contains only a character '#' indicating EOF, don’t proceed it.

Input Format

Each line contains a word composed of upper-case letters except the last line, containing a single character '#'. All lengths of words are no more then 1,000,000 characters.

Output Format

For each word output a single line containing a number.

Sample Input 1

AFGHANISTAN
TAJIKISTAN
STUDENT
TEACHER
FIRST
SECOND
#

Sample Output 1

3
2
3
1
3
1

Hints

Problem Source

Migrated from old NTUJ.

Tmt

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 65536 200