#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; inline bool is_palindrome(string s) { string t = s; reverse(t.begin(), t.end()); return s == t; } int main() { cin.tie(nullptr)->sync_with_stdio(false); int n; string s; cin >> n >> s; int ans = 0; rep(i, n) rep(len, n + 1) { if (len == 0) continue; if (i + len <= n && is_palindrome(s.substr(i, len))) ++ans; } cout << ans << '\n'; return 0; }