#include "iostream"
#include "string"
using namespace std;
int main() {
int j,m; string s; char c; cout << "string: "; getline(cin,s);
for(m=0,c=' ',j=0;s[j]!='.';c=s[j++])m+=s[j]!=' '&&c==' ';
cout<<m<<endl; cin.get();}