#include using namespace std; int len; string str; bool isPalindrome(int x) { for (int i = x; i < str.length(); i++) { if (str[i] != str[len- 1 + x - i]) return false; } return true; } int main() { cin >> len; getchar(); getline(cin, str); for (int i = 0; i < len; i++) { if (isPalindrome(i)) { cout << i << endl; break; } } return 0; }