A,B=map(int,input().split()) print(B-2 if A