def main(): N = int(input()) A = list(map(int, input().split())) print(sum(filter(lambda num: num - 1 not in A, A))) if __name__ == "__main__": main()