# Arup Guha
# 12/3/2023
# Solution to 2023 UCF HS Online D2 Problem: The n Days of Christmas

# Get basic input.
toks = input().split()
n = int(toks[0])
miss = int(toks[1])

# Get days forgotten.
forget = [int(x) for x in input().split()]

res = 0

# Add up the misses
for i in range(miss):

    # Add the appropriate triangular number plus the pause (1)
    res = res + (forget[i]*(forget[i]-1))//2 + 1

# We finally got it!
res += (n*(n+1))//2
print(res)
    
