m@main=getLine>>=putStrLn.f"0"0>>m f x s l|l==""='=':show s|(a,b)<-splitAt(length$x++[' '|x>l])l=a++' ':f a(s+read a)b