def lscan; gets.split.map(&:to_i); end t, a, b = lscan p t/a + t/b - t/a.lcm(b)