#K71587. Longest Word Length

    ID: 33564 Type: Default 1000ms 256MiB

Longest Word Length

Longest Word Length

You are given a string containing several words. Your task is to find the length of the longest word that consists solely of alphabetic characters. The search is case-insensitive and non-alphabetic characters (such as punctuation or digits) must be ignored. If multiple words have the same maximum length, return the length of the first occurrence. If no valid word exists, output 0.

The solution must read the input from standard input (stdin) and output the result to standard output (stdout).

Note: Consider a word to be any sequence of characters separated by whitespace.

inputFormat

The input consists of a single line containing a string. The string may include letters, digits, punctuation, and spaces.

outputFormat

Output a single integer, which is the length of the longest word (comprised only of alphabetic characters) found in the input string.

## sample
Hello world
5