#include<bits/stdc++.h>
#define int long long

using namespace std;

const int N = 2e5;

int readInt ()
{
    bool minus = false;
    int result = 0;
    char ch;
    ch = getchar();
    while (true)
    {
        if (ch == '-') break;
        if (ch >= '0' && ch <= '9') break;
        ch = getchar();
    }
    if (ch == '-') minus = true;
    else result = ch-'0';
    while (true)
    {
        ch = getchar();
        if (ch < '0' || ch > '9') break;
        result = result*10 + (ch - '0');
    }
    if (minus)
        return -result;
    else
        return result;
}
main() {
    string s;
    cin >> s;
    int n = s.size();
    set<char>st;
    for (char c : s) {
        st.insert(c);
    }
    cout << n - (int)st.size();
}
