We call a sequence of strings $*t*_{1}, ..., *t*_{*k*}$ a journey of length $*k*$, if for each $*i* > 1$ $*t*_{*i*}$ is a substring of $*t*_{*i* - 1}$ and length of $*t*_{*i*}$ is strictly less than length of $*t*_{*i* - 1}$. For example, ${*ab*, *b*}$ is a journey, but ${*ab*, *c*}$ and ${*a*, *a*}$ are not.
Define a journey on string $*s*$ as journey $*t*_{1}, ..., *t*_{*k*}$, such that all its parts can be nested inside $*s*$ in such a way that there exists a sequence of strings $*u*_{1}, ..., *u*_{*k* + 1}$ (each of these strings can be empty) and $*s* = *u*_{1} *t*_{1} *u*_{2} *t*_{2}... *u*_{*k*} *t*_{*k*} *u*_{*k* + 1}$. As an example, ${*ab*, *b*}$ is a journey on string $*abb*$, but not on $*bab*$ because the journey strings $*t*_{*i*}$ should appear from the left to the right.
The length of a journey on a string is the number of strings in it. Determine the maximum possible length of a journey on the given string $*s*$.
Input
The first line contains a single integer $*n*$ ($1 ≤ *n* ≤ 500 000$) — the length of string $*s*$.
The second line contains the string $*s*$ itself, consisting of $*n*$ lowercase Latin letters.
Output
Print one number — the maximum possible length of string journey on $*s*$.
Note
In the first sample, the string journey of maximum length is ${*abcd*, *bc*, *c*}$.
In the second sample, one of the suitable journeys is ${*bb*, *b*}$.
样例
7
abcdbcc
3
4
bbcb
2
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。