m@main=getLine>>=print.foldl(%)0>>m x%c=x*8-div(-read[c]*4)5