#include<iostream> #include<set> #include<sstream> using namespace std; int main() { string s,line; while(getline(cin,line)&&line[0]!='#') { stringstream ss(line); set<string> dict; while(ss>>s) dict.insert(s); cout<<dict.size()<<endl; } return 0; }
#include<iostream> #include<set> #include<sstream> using namespace std; int main() { string s,line; while(getline(cin,line)&&line[0]!='#') { stringstream ss(line); set<string> dict; while(ss>>s) dict.insert(s); cout<<dict.size()<<endl; } return 0; }