跳至正文
题库3151
#3151

You're Given a String

查看题目操作

You're Given a String

题目描述

You're given a string of lower-case Latin letters. Your task is to find the length of its longest substring that can be met in the string at least twice. These occurrences can overlap (see sample test 2).

Input

The first input line contains the string. It's guaranteed, that the string is non-empty, consists of lower-case Latin letters, and its length doesn't exceed 100.

Output

Output one number − length of the longest substring that can be met in the string at least twice.

Examples

abcd
0
ababa
3
zzz
2