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