main = do [t,a,b] <- map read . words <$> getLine let ans = (div (t - 1) a + 1) + (div (t - 1) b + 1) - (div (t - 1) (lcm a b) + 1) print ans