a, b = map(int,input().split())
num = int(input())
time = list(map(int,input().split()))
time_num = a + b
total = []
for i in range(num):
figure = time[i] % time_num
figure -= a
if figure > 0:
count = b - figure
elif figure == 0:
count = b
else:
count = 0
total.append(count)
end = 0
for i in range(num):
end += total[i]
print(end)