solve n [a,b,c] = da + db + dc - (dab + dbc + dca) + dabc where da = n `div` a db = n `div` b dc = n `div` c dab = n `div` (lcm a b) dbc = n `div` (lcm b c) dca = n `div` (lcm a c) dabc = n `div` (lcm a (lcm b c)) main = do n <- readLn abc <- map read . words <$> getLine print $ solve n abc