m@main=do x<-getLine;print$sum[round$8-log(256-read y)/0.7|y<-words$map f x];m f '.'=' ' f c=c