a[],i;main(){for(;i=getchar()-10?:!printf("%d",i=fmin(fmin(*a/2,a[13]),a[15]));a[i-91]++);}