main = do
  line <- getLine
  let 
    [a,b,c] = map read $ words line :: [Int]
    divisor cnt seq fin x
      | seq < fin && (mod x seq == 0)  = divisor (cnt+1) (seq+1) fin x
      | seq < fin && (mod x seq /= 0)  = divisor cnt (seq+1) fin x
      | otherwise = do putStrLn $ show cnt
    in divisor 0 a b c

