let m = stdin.ReadLine () |> uint64 |> bigint (Array.replicate 128 (bigint 2) |> Array.reduce (*)) % m |> printfn "%A"