#include <iostream>
#include <string>
using namespace std;
int main() {
int k=0;
string s;
getline(cin, s, '\n');
int i=0;
for(i ; i<s.length(); i++){
if(s[i]==' ') {
k++;
s.erase(i, 1);
i--;
}
}
cout<<s;
if(k==0){
cout << endl << "Пробелов не было.";
}
else{
cout << endl << k;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgaz0wOwoJc3RyaW5nIHM7CglnZXRsaW5lKGNpbiwgcywgJ1xuJyk7CglpbnQgaT0wOwoJZm9yKGkgOyBpPHMubGVuZ3RoKCk7IGkrKyl7CgkJaWYoc1tpXT09JyAnKSB7CgkJCWsrKzsKCQkJcy5lcmFzZShpLCAxKTsKCQkJaS0tOwoJCX0KCX0KCWNvdXQ8PHM7CglpZihrPT0wKXsKCQljb3V0IDw8IGVuZGwgPDwgItCf0YDQvtCx0LXQu9C+0LIg0L3QtSDQsdGL0LvQvi4iOwoJfQoJZWxzZXsKCQljb3V0IDw8IGVuZGwgPDwgazsKCX0KCglyZXR1cm4gMDsKfQ==