open System type Sol() = member this.Solve() = let (A,B) = stdin.ReadLine().Split(' ') |> Array.map int |> fun ss -> (ss.[0], ss.[1]) let f a b = if a > b then (2000000000 - b - 1) else (b - 2) f A B |> printfn "%d" let mySol = new Sol() mySol.Solve()