#include <cstdio>
#include <cstring>
#include <string>
#include <set>
using namespace std;

const int MAX = 200001;
char s[MAX];

bool good(int L, int R) {
    int cnt = 0;
    for (int i = L + 1; i < R; i++) {
        if (s[i] != s[i - 1]) {
            cnt += 1;
            if (cnt > 1) {
                return false;
            }
        }
    }
    return true;
}

int main() {
    freopen("strange.in", "r", stdin);
    freopen("strange.out", "w", stdout);

    scanf("%s", s);
    int n = strlen(s);

    set<string> was;

    for (int L = 0; L < n; L++) {
        for (int R = L + 1; R <= n; R++) {
            if (good(L, R)) {
                char save = s[R];
                s[R] = 0;
                was.insert(string(s + L));
                s[R] = save;
            }
        }
    }

    printf("%d\n", was.size());
}
