跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F2648. You're Given a String

    ID: 2654 传统题 2000ms 256MiB 尝试: 0 已通过: 0 难度: 2 上传者: 标签>枚举贪心算法思想基础难度共享题库Codeforces英文题面题目来源题面语言

You're Given a String

题目描述

A. You're Given a String...
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

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
Input
abcd
Output
0
Input
ababa
Output
3
Input
zzz
Output
2

题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 2309 题。保留原作者与原赛事署名。