#include<iostream>
#include<string>
using namespace std;
int main() {
    string s;
    int t = 0;
    getline(cin, s);
    int n = s.length();
    for (int i = 0; i < n; i++) {
        if (s[i] != ' ')
            t++;
    }
    cout << t;
}