import Data.List main = do n <- readLn [a,b,c] <- sort . map read . words <$> getLine print (fzbz n a b c) fzbz n a b c = da + db + dc - dab - dbc - dac + dabc where da = div n a db = div n b dc = div n c dab = div n (lcm a b) dbc = div n (lcm b c) dac = div n (lcm a c) dabc = div n (lcm (lcm a b) c)