import sys input = sys.stdin.readline from math import gcd,lcm N,A,B=map(int,input().split()) L=lcm(A,B) x=N//A+N//B-N//L print(N-x)