#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
char A[255];
int i,j,n1,n2,n3;
gets(A);
n1=0;n2=0;n3=0;
for(i=0;A[i]!='\0';i++)
{
if(A[i]==' ')
{
n2++;
}
else if(A[i]>=97&&A[i]<=122)
{
n1++;
}
else
{
n3++;
}
}
cout<<n1<<endl;
cout<<n2<<endl;
cout<<n3<<endl;
}