#include using namespace std; using ll=long long; using pp=pair; #define sr string #define vc vector #define db double #define fi first #define se second #define rep(i,n) for(int i=0;i<(int)n;i++) #define pb push_back #define all(v) v.begin(),v.end() #define pque priority_queue #define bpc(a) __builtin_popcount(a) int main(){ sr s;cin>>s; int n=s.size(); vc ok(n,vc(n,false)); rep(i,n){ int l=i,r=i; while(l>=0&&r=0&&rdp(n+1,0); dp[0]=1e9; rep(i,n)for(int j=i+1;j<=n;j++)if(ok[i][j-1]){ int d=j-i; dp[j]=max(dp[j],min(dp[i],d)); } cout<