a=list(map(int,input().split())) abus=False count=0 for i in a[0]: if (a[0]/a[1])%1==0: count+=1 abus=True if (a[0]/a[2])%1==0 and abus==False: count+=1 abus=False print(count)