def main(): n,k = map(int,input().split()) print(k-1) if __name__ == "__main__": main()