let main a b = if a < b then print_int (b-2) else print_int (2000000000 - 1 - b) let () = Scanf.sscanf (read_line()) "%d %d" main; print_endline ""