import Control.Applicative main = getLine >>= print . solve . map read . words solve :: [Int] -> Int solve [x, y, d] = foldl (\acc z -> if z == d then acc + 1 else acc) 0 $ (+) <$> [0..x] <*> [0..y]