N = int(input()) X = int(input()) A = int(input()) Y = sum(A[N]) print(Y-X)