#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cerr.tie(0);
    cout.tie(0);
    string s;
    cin >> s;
    int br = 0;
    for (int i = 0; i < s.length(); i++)
    {
        if (s[i] == s[i + 1] || s[i] == s[i + 3] || s[i] == s[i + 5])
            br++;
    }
    cout << br << endl;
    return 0;
}