Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/string-eng-uzun-takrorsiz-qism

Longest substring without repeats

Medium 1000 ms 128 MB 62%
Share

A string $s$ of lowercase Latin letters is given. Find the length of the longest substring of consecutive characters in which no letter repeats.

The window of the longest substring whose characters are all distinct

Input

One line containing the string $s$.

Output

One integer.

Note

$1 \le |s| \le 10^{5}$
$s$ consists of lowercase Latin letters (a–z) only

Examples

Input #1
abcabcbb
Output #1
3
Input #2
aaaa
Output #2
1

Sign in to submit a solution

Signing up is free and takes a minute.