L = int(input()) N = int(input()) S = input().split() ans = (L-N) ** 2 * len(S) print(ans)