print((function (n, s) local a=n*(n+1)/2 local b=0 for e in s:gmatch("%d+") do b=b+tonumber(e) end return math.abs(a-b) end)(io.stdin:read("*l"), io.stdin:read("*l")))