succDivisor :: Int -> Int -> Int -> Int
succDivisor d x sum = if (mod d x == 0) then (sum + 1) else sum

main :: IO ()
main = do
  input <- getLine
  let [a, b, c] = map read $ words input :: [Int]
  putStrLn $ show $ foldr (succDivisor c) 0 [a..b]