"""

import sys

# input
inp = sys.stdin.readlines()

x = int(inp[0])
n = int(inp[1])

months = map(int, inp[2:])

"""

def tarifa(x, n, *months):
    ans = (n + 1) * x
    print(ans - sum(months))
    return ans - sum(months)


test(tarifa(10, 3, 4, 6, 2), 28)

c4ed609d5f218860e95466663f48a3732112e663
<mask token>

<mask token>


def tarifa(x, n, *months):
    ans = (n + 1) * x
    print(ans - sum(months))
    return ans - sum(months)


<mask token>

<mask token>


def tarifa(x, n, *months):
    ans = (n + 1) * x
    print(ans - sum(months))
    return ans - sum(months)


test(tarifa(10, 3, 4, 6, 2), 28)

"""

import sys

# input
inp = sys.stdin.readlines()

x = int(inp[0])
n = int(inp[1])

months = map(int, inp[2:])

"""

def tarifa(x, n, *months):
    ans = (n + 1) * x
    print(ans - sum(months))
    return ans - sum(months)


test(tarifa(10, 3, 4, 6, 2), 28)
