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 divisorOf x y = mod y x == 0 da = div n a db = if divisorOf a b then 0 else div n b dc = if divisorOf a c || divisorOf b c then 0 else div n c dab = if db == 0 then 0 else div n (a*b) dbc = if db == 0 || dc == 0 then 0 else div n (b*c) dac = if dc == 0 then 0 else div n (a*c) dabc = if db == 0 || dc == 0 then 0 else div n (a*b*c)