main@m=do s@(c:_)<-getLine;putStrLn$c:' ':last s:' ':show(sum[1|x<-s,x==c]);m