i=input;i();print sum(map(int,raw_input().split()))-i()