import qualified Data.ByteString.Char8 as B
import Data.Maybe
import Data.List

main = do
 getLine
 xys <- map (map (fromIntegral . fst . fromJust . B.readInt) . B.words) . B.lines <$> B.getContents
 let [mins,maxs] = transpose (map sort xys)
 print (colorling mins maxs)

colorling mins maxs
 | xmin >= nmax = (xmin-nmax) * (xmax-nmin)
 | otherwise = (xmin-nmin) * (xmax-nmax)
  where
   nmin = minimum mins
   xmin = maximum mins
   nmax = minimum maxs
   xmax = maximum maxs