#include <iostream>
#include<cstdio>
#include<cstring>
#include<map>
#include<vector>
#include<algorithm>
#define mfor for(it=mp.begin();it!=mp.end();it++)
using namespace std;
int main()
{
//freopen("in.txt","r",stdin);
// freopen("out.txt","w",stdout);
char ss[50000];
string str;
map<int,int>mp;
map<int,int>:: iterator it;
while(gets(ss))
{
if(ss[0]=='#')
{
str.erase(remove(str.begin(),str.end(),'-'),str.end());
str.erase(remove(str.begin(),str.end(),'\''),str.end());
char xx[10000];
strcpy(xx,str.c_str());
char *token;
token=strtok(xx," ");
while(token!=NULL)
{
int l=strlen(token);.
mp[l]++;
token=strtok(NULL," ");
}
mfor { cout<<it->first<<" "<<it->second<<endl;}
mp.clear();
str.clear();
cout<<endl;
}
else
{
char *ptr;
ptr=strtok(ss," ,.!?");
while(ptr!=NULL)
{
string temp=ptr;
int l=temp.length();
str+=ptr;
if(temp[l-1]!='-')str+=" ";
ptr=strtok(NULL," ,.!?");
}
}
}
return 0;
}
#include<cstdio>
#include<cstring>
#include<map>
#include<vector>
#include<algorithm>
#define mfor for(it=mp.begin();it!=mp.end();it++)
using namespace std;
int main()
{
//freopen("in.txt","r",stdin);
// freopen("out.txt","w",stdout);
char ss[50000];
string str;
map<int,int>mp;
map<int,int>:: iterator it;
while(gets(ss))
{
if(ss[0]=='#')
{
str.erase(remove(str.begin(),str.end(),'-'),str.end());
str.erase(remove(str.begin(),str.end(),'\''),str.end());
char xx[10000];
strcpy(xx,str.c_str());
char *token;
token=strtok(xx," ");
while(token!=NULL)
{
int l=strlen(token);.
mp[l]++;
token=strtok(NULL," ");
}
mfor { cout<<it->first<<" "<<it->second<<endl;}
mp.clear();
str.clear();
cout<<endl;
}
else
{
char *ptr;
ptr=strtok(ss," ,.!?");
while(ptr!=NULL)
{
string temp=ptr;
int l=temp.length();
str+=ptr;
if(temp[l-1]!='-')str+=" ";
ptr=strtok(NULL," ,.!?");
}
}
}
return 0;
}