#include <iostream>
#include <cstring>
#include <string>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <math.h>
#include<iostream>
#include <map>
using namespace std;
#define INF 0xfffff;//0x代表十六进制
string s1;
string s2; //捕获s1的单词
map<string, int>m;
int main()
{
while (getline(cin, s1), s1 != "#")
{
s1 += '\''; //以空格判断单词
m.clear();
int l = s1.length(), f;
for (int i = 0; i < l; i++)
{
if (s1[i] >= 'a'&&s1[i] <= 'z')
{
s2 += s1[i];
f = 1;
}
else if (f) //f防止连续空格
{
m[s2]++;
s2.clear();
f=0;
}
}
cout << m.size() << endl;
}
}
#include <cstring>
#include <string>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <math.h>
#include<iostream>
#include <map>
using namespace std;
#define INF 0xfffff;//0x代表十六进制
string s1;
string s2; //捕获s1的单词
map<string, int>m;
int main()
{
while (getline(cin, s1), s1 != "#")
{
s1 += '\''; //以空格判断单词
m.clear();
int l = s1.length(), f;
for (int i = 0; i < l; i++)
{
if (s1[i] >= 'a'&&s1[i] <= 'z')
{
s2 += s1[i];
f = 1;
}
else if (f) //f防止连续空格
{
m[s2]++;
s2.clear();
f=0;
}
}
cout << m.size() << endl;
}
}