N, K = map(int, input().split()) ans = K-1 print(ans)