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

int cnt[26];

int main() {
	string s; cin >> s;
	reverse(s.begin(), s.end());
	long long ans = 0;
	vector <int> all;
	for (int i = 0; i < s.size(); i++) {
		int j = i;
		while (j < s.size() && s[i] == s[j]) j++;
		if (j - i >= 2) {
			ans += i - cnt[s[i] - 'a'];
			memset(cnt, 0, sizeof(cnt)), cnt[s[i] - 'a'] = j;
		} else cnt[s[i] - 'a']++;
		i = j - 1;
	}
	cout << ans << endl;
	return 0;
}

#include <bits/stdc++.h>          
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repp(i, st, en) for (ll i = (ll)st; i < (ll)(en); i++)
#define repm(i, st, en) for (ll i = (ll)st; i >= (ll)(en); i--)
#define all(v) v.begin(), v.end()
void chmax(ll &x, ll y) {x = max(x,y);}
void chmin(ll &x, ll y) {x = min(x,y);}
void Yes() {cout << "Yes" << endl; exit(0);}
void No() {cout << "No" << endl; exit(0);}
template<class in_Cout> void Cout(in_Cout x) {cout << x << endl; exit(0);}
template<class in_vec_cout>
void vec_cout(vector<in_vec_cout> vec) {
    for (in_vec_cout res : vec) {cout << res << " ";}
    cout << endl;
}

const ll inf = 1e18;
const ll mod = 1e9 + 7;

// 計算量 O(√N)
ll prime_cnt(ll N) {
    ll res = 0;
    for (ll i=2; i*i<=N; i++) {
        if (N%i!=0) continue;
        while (N%i==0) {
            N /= i;
            res++;
        }
    }
    if (N!=1) res++;
    return res;
}

int main() {
    ll N; cin >> N;
    for (ll i=1; i<=N; i++) {
        cout << prime_cnt(i) + 1 << " ";
    }
    cout << endl;
}