import           Control.Monad
import           Data.Array.IO

readInts :: IO [Int]
readInts = map read . words <$> getLine

main :: IO ()
main = do
  [n, m, k] <- readInts
  a_ary <- newArray ((0, 0), (n, n)) 0 :: IO (IOUArray (Int, Int) Int)
  b_ary <- newArray ((0, 0), (n, n)) 0 :: IO (IOUArray (Int, Int) Int)
  lrs <- replicateM m readInts
  pqs <- replicateM k readInts

  forM_ lrs $ \[l, r] ->
    writeArray a_ary (l, r) =<< (+1) <$> readArray a_ary (l, r)

  forM_ [1..n] $ \i ->
    forM_ [1..n] $ \j ->
      writeArray b_ary (i, j) =<< (\x y z w -> x + y - z + w)
        <$> readArray b_ary (i-1, j)
        <*> readArray b_ary (i, j-1)
        <*> readArray b_ary (i-1, j-1)
        <*> readArray a_ary (i, j)

  forM_ pqs $ \[p, q] ->
    print =<< (\x y z w -> x - y - z + w)
      <$> readArray b_ary (q, q)
      <*> readArray b_ary (p-1, q)
      <*> readArray b_ary (q, p-1)
      <*> readArray b_ary (p-1, p-1)