using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Yuki { class Program { static void Main(string[] args) { string[] s = Console.ReadLine().Split(); ; int a = int.Parse(s[0]); int b = int.Parse(s[1]); int ans; if (a > b) { ans = 2000000000 - b - 1; } else { ans = b - 2; if (b == 0) { ans = 0; } } Console.WriteLine(ans); } } }