#include<iostream>
#include <string>
using namespace std;
bool isEnglish(char ch) {
int n = (int)ch;
return (n >= (int)'a' && n <= (int)'z') || (n >= (int)'A' && n <= (int)'Z');
}
int main() {
string s;
while (getline(cin, s)) {
int i = 0, len = s.length();
int workSpace = 0, count = 0;
char ch;
for (i = 0; i < len; i++) {
ch = s.at(i);
if (!workSpace && isEnglish(ch)) {
count += 1;
workSpace = 1;
}
else if (workSpace && !isEnglish(ch) && ch != '-') {
workSpace = 0;
}
}
cout << count << endl;
}
}
// i love you,do you love me too?
// i like ice-cream.
//you are pe000ppa.