import sys input = sys.stdin.readline N,A,B=list(map(int,input().split())) ANS=0 for i in range(1,N+1): if i%A>i%B: ANS+=1 print(ANS)