import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random #sys.setrecursionlimit(10**9) n = int(input()) alist = list(map(int,input().split())) #hen = collections.defaultdict(list) #s = input() # print(alist[-1]-n)