#include //#include using namespace std; //using namespace atcoder; using ll = long long; //using mint = modint998244353; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); int N; cin >> N; string s; cin >> s; if (N<=4){ cout << 0 << endl; return 0; } vector w; vector> v; auto dfs=[&](auto self, int now, int x)->void{ if (now == 5){ if (w.size() == 5) v.push_back(w); return; } for (int i=x; i st = {s[x[0]], s[x[1]], s[x[2]], s[x[3]], s[x[4]]}; if (s[x[0]] == s[x[2]] && st.size() == 4) ans++; } cout << ans << endl; return 0; }