#include <bits/stdc++.h>
using namespace std;

#define ls n << 1
#define rs n << 1 | 1
#define PB push_back
#define MP make_pair
#define LD double
#define int long long
#define LL long long
#define pii pair<int, int>
#define fi first
#define se second
const int N = 500;
const int M = 300;
const int mod = 1e9 + 7;
const LL inf = 1e18;
// inline char nc() {
//     static char buf[1000000], *p1 = buf, *p2 = buf;
//     return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2) ? EOF : *p1++;
// }
// #define getchar nc
inline int read() {
    int s = 0;
    register bool neg = 0;
    register char c = getchar();
    for (; c < '0' || c > '9'; c = getchar())
        neg |= (c == '-');
    for (; c >= '0' && c <= '9'; s = s * 10 + (c ^ 48), c = getchar())
        ;
    s = (neg ? -s : s);
    return s;
}

int a;

inline int calc(int n) {
    int res = 0;
    for (int i = 2; i <= sqrt(n); i++) {
        if (n % i == 0) {
            while (n % i == 0) n /= i, res++;
        }
    }
    if (n != 1) res++;
    return res;
}

signed main() {
    // freopen("in1.in", "r", stdin);
    // freopen("out.out", "w", stdout);
    a = read();
    for (int i = 1; i <= a; i++) {
        printf("%lld ", calc(i) + 1);
    }
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long; using P = pair<int,int>;
using vl = vector<ll>; using vvl = vector<vl>;
#define mp make_pair
#define pb push_back
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(i,n) for (int i=(n-1);i >= 0;i--)
#define all(v) v.begin(),v.end()
#define sz(v) (int)((v).size())
#define MAX(v) *max_element(all(v))
#define MIN(v) *min_element(all(v))
#define Sort(v) sort(all(v))
#define Rev(v) reverse(all(v))
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
#define VEC(type,name,size) vector<type> name(size);in(name)
#define vv(type,name,h,...) vector<vector<type>>name(h,vector<type>(__VA_ARGS__))
#define VV(type,name,h,w) vector<vector<type>>name(h,vector<type>(w));in(name)
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cout << H << " ";
    debug_out(T...);
}
#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...) 
#endif
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
    for (std::size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
    return os;
}
inline void IN(void){return;}
template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){cin >> first;IN(rest...);return;}
template<class T>bool chmax(T &a, const T &b) {if(a<b){a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) {if(b<a){a=b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll mod = 1000000007;
const int dx[8] = {1,0,-1,0,1,1,-1,-1}; const int dy[8] = {0,1,0,-1,1,1,-1,-1};

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<char> s(n);
    vector<int> A(n+1), T(n+1), G(n+1), C(n+1);
    rep(i,n) cin >> s[i];
    rep(i, 1, n+1) {
        A[i] += A[i-1]; T[i] += T[i-1]; G[i] += G[i-1]; C[i] += C[i-1];
        if(s[i-1] == 'A') A[i]++;
        else if(s[i-1] == 'T') T[i]++;
        else if(s[i-1] == 'G') G[i]++;
        else C[i]++;
    }
    ll ans = 0;
    rep(i, n) rep(j, i+1, n) {
        if((j-i)%2 == 0) continue;
        int a = A[j+1]-A[i];
        int t = T[j+1]-T[i];
        int g = G[j+1]-G[i];
        int c = C[j+1]-C[i];
        if(a == t && g == c) ans++;
    }
    cout << ans << endl;
}