N,A,B=map(int,input().split());print(sum(i%A>i%B for i in range(N+1)))