c=0d=0e=0f=0g=0a,b=map(int, input().split())e=a+bn = int(input())list_a = list(map(int, input().split()))for i in range(n): c=list_a[i]%(e) if c != 0 and c >= a: f=c-a g=b-f d+=g else: d+=0print(d)