#include using namespace std; typedef unsigned long long ull; typedef long long ll; typedef string str; const ll mod = 1e9 + 7; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); str s; ll n, countt = 0; cin >> n >> s; str p; for (ll i = 0; i < s.size(); i++) { p = s[i]; countt++; for (ll j = i + 1; j < s.size(); j++) { p += s[j]; str r = p; reverse(r.begin(), r.end()); if (r == p) countt++; } } cout << countt; return 0; }