Bomboslav set up a branding agency and now helps companies to create new logos and advertising slogans. In term of this problems, slogan of the company should be a non-empty substring of its name. For example, if the company name is "hornsandhoofs
", then substrings "sand
" and "hor
" could be its slogans, while strings "e
" and "hornss
" can not.
Sometimes the company performs rebranding and changes its slogan. Slogan abacaba
" is cooler than slogan ba
", slogan abcbcbe
" is cooler than slogan bcb
", but slogan aaaaaa
" is not cooler than slogan aba
".
You are given the company name
Subtask # | Score | Constraints |
---|---|---|
1 | 5 | |
2 | 24 | |
3 | 17 | There exists an |
4 | 54 | No additional constraints |
The input consists of a string of lowercase English letters on a single line,
Output a the single integer - the maximum possible length of the sequence of slogans of the company named
Sample Input 1 | Sample Output 1 |
qaqaqzz
|
3
|
Explanation
qaqaqzz
qaq
q
Sample Input 2 | Sample Output 2 |
dabcabcabcabca
|
5
|
Explanation
abcabcabcabca
abcabcabca
abcabca
abca
a
Sample Input 3 | Sample Output 3 |
abracadabra
|
3
|
Explanation
abracadabra
abra
a
Subtask | Score |
---|---|
1 | 5 |
2 | 24 |
3 | 17 |
4 | 54 |