let f c = int(c)%81%76 stdin.ReadLine() |> Seq.map f |> Seq.fold (fun acm n -> acm * 2 + n) 1 |> printfn "%d"