#45435: easy


0801elmer666@gmail.com (薛冠志)


a, b = map(int,input().split())
num = int(input())
time = list(map(int,input().split()))
total = 0
for i in range(num):
  total_num = 0
  one = a + b
  plus = time[i] % one
  green = plus - a
  if green < 0:
    total_num = 0
  elif green == 0:
    total_num = b
  else:
    total_num = b - green
  total += total_num
print(total)