import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from math import gcd T,A,B = map(int,read().split()) L = A*B//gcd(A,B) T -= 1 answer = (T//A) + (T//B) - (T//L) + 1 print(answer)