#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MASK(x) (1LL << (x))
#define BIT(x, i) (((x) >> (i)) & 1)
#define SZ(x) ((int) (x).size())
#define ALL(a) (a).begin(), (a).end()
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define FORD(i, a, b) for (int i = (a); i >= (b); --i)
#define debug(x) cerr << "[" << #x << " = " << (x) << "]" << endl
#define left    __left
#define right   __right
#define prev    __prev
#define fi      first
#define se      second
template <class X, class Y>
    bool maximize(X &x, Y y) {
        if (x < y) return x = y, true;
        else return false;
    }
template <class X, class Y>
    bool minimize(X &x, Y y) {
        if (x > y) return x = y, true;
        else return false;
    }
string s;
int main() {
    ios_base::sync_with_stdio(false);cin.tie(nullptr);
    cin >> s;
    s += 'M';
    set <int> se;
    int ans = 0;
    char last = 'A';
    for (char c : s) {
        if (c >= '0' && c <= '9') ans = ans * 10 + (c - '0');
        else {
            if (last >= '0' && last <= '9') se.insert(ans), ans = 0;
        }
        last = c;
    }
    cout << SZ(se);
    return 0;
}
/* Discipline - Calm */
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |