#include using namespace std; typedef long double ld; typedef long long ll; typedef pair ii; typedef pair dd; typedef vector vi; typedef vector vll; typedef vector> vvi; typedef vector vii; int kmp_step(char x, string &needle, int s, int* f){ while(s> 0 && needle[s] != x) s = f[s-1]; if (needle[s] == x) s++; return s; } void kmp_construct(int *f, string &needle){ f[0] =0; for(int i =1;i> N; string s; cin >> s; string sR(s); for(int i = 0; i < N; ++i) sR[i] = s[N-1-i]; cout << N-kmp_search(sR, s) << endl; }