T,A,B = gets.split.map(&:to_i) puts (T - 1) / A + (T - 1) / B - (T - 1) / A.lcm(B) + 1