import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c=0; if(ab){ if(a==2000000000) c=a-b-1; else if(a-1==b) c=2000000000-a; else c=(2000000000-a)+(a-b-1); } System.out.println(c); } }