#include #include using namespace std; int main() { int n; string s; cin >> n >> s; int ans = 0; for (int c = 1; c <= s.length(); c++) { for (int i = 0; i + c <= s.length(); i++) { int d = 0; for (int j = 0; j < c; j++) { if (s[i+j] == s[i+c-1-j]) { d++; } } if (c == d) { ans++; } } } cout << ans << endl; }