import math as m def lcm(x, y): return (x * y) // m.gcd(x, y) T, A, B = map(int, input().split()) T = m.floor(T) #How many times bus A departs ? x = T/A y = T/B #How many times both buses depart simultaneously? xy = T/lcm(A, B) print(int(x + y - xy))