using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yukicoder_333 { class Program { static void Main(string[] args) { int[] h = Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); if (h[0] < h[1]) { Console.WriteLine(h[1] - 2); } else { Console.WriteLine(2000000000 - h[1] - 1); } Console.ReadLine(); } } }