import sys readline=sys.stdin.readline from math import gcd as GCD T,A,B=map(int,readline().split()) lcm=A*B//GCD(A,B) ans=(T+A-1)//A+(T+B-1)//B-(T+lcm-1)//lcm print(ans)