#include<stdio.h>
using namespace std;
int main(){
int temp=0,j=0,flag=1,a[300]={0};
char c[1000]={};
fgets(c,1000,stdin);
for(int i=0;i<strlen(c)-1;i++){
if(c[i]!=32){
flag=1;
temp++;
}else{
if(flag==1){
a[j++]=temp;
flag=0;
temp=0;
}
continue;
}
if(i==strlen(c)-2)
a[j++]=temp;
}
for(int i=0;i<j;i++){
if(i<j-1)
cout<<a[i]<<',';
else
cout<<a[i];
}
}