import List main=interact$(>>= \x->show(sum[1|"*"<-x]`div`2)++"\n").groupBy(>).init.words