f x y=x++[y];m@main=do w<-getLine;putStrLn$([f"",f"1"]<*>"0123456789AB")!!sum(read.f"0x0"<$>w);m