#include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); string s; int n; cin >> n >> s; long long countt = 0; int len = s.length(); for (int i = 0; i < len; i++) { int l = i, r = i; while (l >= 0 && r < len && s[l] == s[r]) { countt++; l--; r++; } l = i, r = i + 1; while (l >= 0 && r < len && s[l] == s[r]) { countt++; l--; r++; } } cout << countt; return 0; }