LearnPy Hub
← Arena
AdvancedRating 1900

Longest Repeated Piece

Print the length of the longest substring that appears at least twice in the string (the two copies may overlap).

Input

One string (length ≤ 3000).

Output

One integer.

Sample 1

Input
banana
Output
3

Sample 2

Input
abcd
Output
0
solution.py
Output appears here
Longest Repeated Piece · Python Arena problem · LearnPy Hub