a,b=map(int,input().split()) print([b-2,2000000000-a][b