input() p=[*map(int,input().split())] print(sum(n for n in p if n-1 not in p))