main :: IO ()
main = do
  [a, b, x] <- map toInt . words <$> getLine
  print . sum $ map (ismod x) [a, a+x..b] 

ismod :: Int -> Int -> Int
ismod x num = if mod num x == 0 then 1 else 0

toInt :: String -> Int 
toInt = read