main = do
  s <- getLine
  let [a,b,c] = map (read :: String->Int) . words $ s
  let iter n ct = if n > b then ct
                 else
                   iter (n+1) (if mod c n == 0 then (ct+1) else ct)
  putStrLn . show $ iter a 0