import Data.Array
import Control.Monad
import Data.Maybe

data Item = Item { _x :: Int, _y:: Int, _t:: String } deriving Show

data MinMax = MinMax { _min :: Int, _max:: Int } deriving Show
data MinMax2 = MinMax2 { _mmx::MinMax, _mmy::MinMax } deriving Show
data MinMaxs = MinMaxs { _r::MinMax2, _l::MinMax2, _u::MinMax2, _d::MinMax2 } deriving Show

getMinMax2 ::Int -> Int -> MinMax2 -> MinMax2
getMinMax2 x y minmax2 =   
    MinMax2 (MinMax min_x max_x) (MinMax min_y max_y)
    where 
        min_x = min x $ (_min._mmx) minmax2
        max_x = max x $ (_max._mmx) minmax2
        min_y = min y $ (_min._mmy) minmax2
        max_y = max y $ (_max._mmy) minmax2

getMinMax :: Item -> MinMaxs -> MinMaxs

getMinMax (Item { _x = _x, _y = _y, _t = "R" }) minmaxs = MinMaxs (getMinMax2 _x _y (_r minmaxs)) (_l minmaxs) (_u minmaxs) (_d minmaxs)
getMinMax (Item { _x = _x, _y = _y, _t = "L" }) minmaxs = MinMaxs (_r minmaxs) (getMinMax2 _x _y (_l minmaxs)) (_u minmaxs) (_d minmaxs)
getMinMax (Item { _x = _x, _y = _y, _t = "U" }) minmaxs = MinMaxs (_r minmaxs) (_l minmaxs) (getMinMax2 _x _y (_u minmaxs)) (_d minmaxs)
getMinMax (Item { _x = _x, _y = _y, _t = "D" }) minmaxs = MinMaxs (_r minmaxs) (_l minmaxs) (_u minmaxs) (getMinMax2 _x _y (_d minmaxs))

mergeMinMax :: MinMax -> MinMax -> MinMax
mergeMinMax mm1 mm2 =
    MinMax (min (_min mm1) (_min mm2)) (max (_max mm1) (_max mm2))

maybeMinMax :: MinMax -> Maybe MinMax
maybeMinMax mm
    | (_min mm) <= (_max mm) = Just mm
    | otherwise = Nothing

ketsugou :: Maybe a -> Maybe a -> Maybe a
ketsugou mm1 mm2 = if (isJust mm1) then mm1 else mm2

calcTime :: Maybe MinMax -> Maybe MinMax -> Maybe MinMax -> ((Maybe Int,Int,Int,Maybe Int),(Maybe Int,Int,Int,Int,Maybe Int))

-- i : increment
-- d : decrement
-- c : constant
calcTime (Just mmi) (Just mmd) (Just mmc) =    
    ((Just t12_x2, t23_x2, t34_x2, Just t45_x2),(Just h1_x2,h2_x2,h3_x2,h4_x2,Just h5_x2))
    where

        i_min = _min mmi
        i_max = _max mmi
        c_min = _min mmc
        c_max = _max mmc
        d_min = _min mmd
        d_max = _max mmd

        ic_min_x2 = 2 * (c_min - i_min)
        cd_min_x2 = 2 * (d_min - c_min)
        id_min_x2 = d_min - i_min

        cd_max_x2 = 2 * (d_max - c_max)
        ic_max_x2 = 2 * (c_max - i_max)
        id_max_x2 = d_max - i_max

        tmin1_x2 = min ic_min_x2 id_min_x2
        tmin2_x2 = max id_min_x2 cd_min_x2
        tmax1_x2 = min cd_max_x2 id_max_x2
        tmax2_x2 = max id_max_x2 ic_max_x2

        h1_x2 = 2 * ( d_max - i_min )

        h2_x2 = if tmin1_x2 < tmax1_x2
                    then 
                        if tmin1_x2 < tmin2_x2
                        then
                            2 * (d_max - c_min) 
                        else
                            (2 * d_max) - (i_min + d_min)
                    else 
                        if tmax1_x2 < tmax2_x2
                        then
                            2 * (c_max - i_min)
                        else
                            (i_max + d_max) - (2 * i_min)

        h3_x2 = if tmin2_x2 < tmax1_x2
                    then 
                        2 * (d_max - d_min) 
                    else 
                        if tmax2_x2 < tmin1_x2
                        then
                            2 * (i_max - i_min) 
                        else
                            if tmin1_x2 < tmin2_x2
                            then
                                if tmax1_x2 < tmax2_x2
                                then
                                    2 * (c_max - c_min) 
                                else
                                    ((i_max + d_max) - 2 * c_min) 
                            else
                                if tmax1_x2 < tmax2_x2
                                then
                                    (2 * c_max - (i_min + d_min)) 
                                else
                                    ((i_max + d_max) - (i_min + d_min)) 

        h4_x2 = if tmin2_x2 < tmax2_x2
                    then 
                        if tmax1_x2 < tmax2_x2
                        then
                            2 * (c_max - d_min ) 
                        else
                            (i_max + d_max) - (2 * d_min) 
                    else 
                        if tmin1_x2 < tmin2_x2
                        then
                            2 * (i_max -  c_min)
                        else
                            (2 * i_max) - (i_min + d_min)

        h5_x2 = 2 * ( i_max - d_min ) 

        t12_x2 = minimum [ic_min_x2, id_min_x2, cd_max_x2, id_max_x2]
        t23_x2 = min (max tmin1_x2 tmax1_x2) (min tmin2_x2 tmax2_x2)
        t34_x2 = max (max tmin1_x2 tmax1_x2) (min tmin2_x2 tmax2_x2)
        t45_x2 = maximum [id_min_x2, cd_min_x2, id_max_x2, ic_max_x2]

calcTime (Just mmi) (Just mmd) Nothing =    
    ((Just t12_x2, t23_x2, t34_x2, Just t45_x2),(Just h1_x2,h2_x2,h3_x2,h4_x2,Just h5_x2))
    where

        i_min = _min mmi
        i_max = _max mmi
        d_min = _min mmd
        d_max = _max mmd

        id_min_x2 = d_min - i_min

        id_max_x2 = d_max - i_max

        h1_x2 = 2 * ( d_max - i_min )

        h2_x2 = if id_min_x2 < id_max_x2
                    then 
                        (2 * d_max) - (i_min + d_min)
                    else 
                        (i_max + d_max) - (2 * i_min)

        h3_x2 = if id_min_x2 < id_max_x2
                    then 
                        2 * (d_max - d_min) 
                    else 
                        if id_max_x2 < id_min_x2
                        then
                            2 * (i_max - i_min) 
                        else
                            2 * ((i_max + d_max) - (i_min + d_min)) 

        h4_x2 = if id_min_x2 < id_max_x2
                    then 
                        (i_max + d_max) - (2 * d_min) 
                    else 
                        (2 * i_max) - (i_min + d_min)

        h5_x2 = 2 * ( i_max - d_min ) 

        t12_x2 = min id_min_x2 id_max_x2
        t23_x2 = min id_min_x2 id_max_x2

        t34_x2 = max id_min_x2 id_max_x2
        t45_x2 = max id_min_x2 id_max_x2

calcTime (Just mmi) Nothing (Just mmc) =    
    ((Nothing, t23_x2, t34_x2, Nothing),(Nothing,h2_x2,h3_x2,h4_x2,Nothing))
    where

        i_min = _min mmi
        i_max = _max mmi
        c_min = _min mmc
        c_max = _max mmc

        ic_min_x2 = 2 * (c_min - i_min)
        ic_max_x2 = 2 * (c_max - i_max)

        h2_x2 = 2 * (c_max - i_min)

        h3_x2 = if ic_min_x2 < ic_max_x2
                then
                    2 * (c_max - c_min)
                else
                    2 * (i_max - i_min)

        h4_x2 =  2 * (i_max -  c_min)

        t23_x2 = min ic_min_x2 ic_max_x2

        t34_x2 = max ic_min_x2 ic_max_x2


calcTime Nothing (Just mmd) (Just mmc) =    
    ((Nothing, t23_x2, t34_x2, Nothing),(Nothing,h2_x2,h3_x2,h4_x2,Nothing))
    where

        c_min = _min mmc
        c_max = _max mmc
        d_min = _min mmd
        d_max = _max mmd

        cd_min_x2 = 2 * (d_min - c_min)
        cd_max_x2 = 2 * (d_max - c_max)

        h2_x2 = 2 * (d_max - c_min)

        h3_x2 = if cd_min_x2 < cd_max_x2
                then
                    2 * (d_max - d_min)
                else
                    2 * (c_max - c_min)

        h4_x2 =  2 * (c_max -  d_min)

        t23_x2 = min cd_max_x2 cd_min_x2

        t34_x2 = max cd_max_x2 cd_min_x2

main :: IO()
main = do

    n <- (read :: String -> Int)  <$> getLine

    arr <- map words <$> replicateM n getLine

    let arr2 = do 
        [x, y, d] <- arr
        let x' = (read :: String -> Int) x
        let y' = (read :: String -> Int) y
        return $ Item x' y' d

    let initMinMax  = MinMax maxBound minBound

    let initMinMax2 = MinMax2 initMinMax initMinMax

    let seed = MinMaxs initMinMax2 initMinMax2 initMinMax2 initMinMax2

    let MinMaxs { _r = _r, _l = _l, _u = _u, _d = _d } = foldr getMinMax seed arr2

    let r_mmx = maybeMinMax $ _mmx _r

    let l_mmx = maybeMinMax $ _mmx _l

    let rl_mmy = maybeMinMax $ mergeMinMax (_mmy _r) (_mmy _l)

    let u_mmy = maybeMinMax $ _mmy _u

    let d_mmy = maybeMinMax $ _mmy _d

    let ud_mmx = maybeMinMax $ mergeMinMax (_mmx _u) (_mmx _d)

    let ((tx1,tx2,tx3,tx4),(hx1,hx2,hx3,hx4,hx5)) = calcTime r_mmx l_mmx ud_mmx

    let ((ty1,ty2,ty3,ty4),(hy1,hy2,hy3,hy4,hy5)) = calcTime u_mmy d_mmy rl_mmy 

    let result25 = do
        _hy5 <- hy5
        return [(tx2, hx3 * (_hy5 + (2 * tx2)))]  

    let result24 = if maybe True ( tx2 < ) ty4
        then
            Just [(tx2, hx3 * (hy4 + tx2))] 
        else
            do
                _ty4 <- ty4
                _result25 <- result25
                return $ (_ty4, (hx2 - _ty4) * (hy4 + _ty4)) : _result25 

    let result15 = do
        _tx1 <- tx1
        _hy5 <- hy5
        _result25 <- result25
        return $ (_tx1,(hx2 - _tx1) * (_hy5 + 2 * _tx1)) : _result25 

    let result14 = do
        _tx1 <- tx1
        _result24 <- result24
        _result15 <- result15
        if maybe True ( _tx1 < ) ty4
        then
            return $ (_tx1,(hx2 - _tx1) * (hy4 - _tx1)) : _result24
        else
            do 
                _hx1 <- hx1
                _ty4 <- ty4
                return $ (_ty4,(_hx1 - 2 * _ty4) * (hy4 + _ty4)) : _result15 

    -- 9個全部計算してまえ！
    let result0 = if ty3 < tx2 
        then 

            if maybe True ( < ty3) tx1
            then
                do  
                    _result24 <- result24
                    return $ (ty3, (hx2 - ty3) * hy3) : _result24 
            else
                do
                    _hx1 <- hx1
                    _result14 <- result14
                    return $ (ty3,(_hx1 - 2 * ty3) * hy3) : _result14 

        else 
            Nothing 

    let result52 = do
        _hx5 <- hx5
        return [(ty2, hy3 * (_hx5 + 2 * ty2))]

    let result51 = do
        _hx5 <- hx5
        _ty1 <- ty1
        _result52 <- result52
        return $ (_ty1, hy3 * (_hx5 + 2 * _ty1)) : _result52

    let result42 = do
        _hx5 <- hx5
        _ty1 <- ty1
        _result52 <- result52
        if maybe True ( ty2 < ) tx4
        then
            return $ [(ty2, (hx4 + ty2) * hy3)]
        else
            do
                _tx4 <- tx4
                return $ (_ty1, (hx4 + _tx4) * (hy2 - _tx4) ) : _result52

    let result41 = do
        _result42 <- result42
        _result51 <- result51
        _ty1 <- ty1
        if maybe True ( _ty1 < ) tx4
        then
            return $ (_ty1, (hx4 + _ty1) * (hy2 - _ty1)) :_result42
        else
            do
                _tx4 <- tx4
                _hy1 <- hy1
                return $ (_tx4, (hx4 + _tx4) * (_hy1 - 2 * _tx4) ) : _result51

    let result10 = if tx3 < ty2 
        then 
            if maybe True ( < tx3 ) ty1
            then
                do
                    _result42 <- result42
                    return $ (tx3, hx3 * (hy2 - tx3)) : _result42
            else
                do
                    _hy1 <- hy1
                    _result41 <- result41
                    return $ (tx3,hx3 * (_hy1 - 2 * tx3)) :_result41
        else 
            Nothing

    let result_center = if (max tx2 ty2 ) <= (min tx3 ty3)
        then 
            Just [((min tx3 ty3),(hx3 * hy3))]
        else
            Nothing

    let array_result = catMaybes [result_center, result10, result0]

    let result_zero =   let x1 = minimum $ map _min $ catMaybes [r_mmx, l_mmx, ud_mmx] in
                        let x2 = maximum $ map _max $ catMaybes [r_mmx, l_mmx, ud_mmx] in
                        let y1 = minimum $ map _min $ catMaybes [u_mmy, d_mmy, rl_mmy] in
                        let y2 = maximum $ map _max $ catMaybes [u_mmy, d_mmy, rl_mmy] in
                        4 * (x2 - x1) * (y2 - y1)

    let isOneKind = (1 == ) $ length $ catMaybes [r_mmx, l_mmx, u_mmy, d_mmy]

    print $ (/4) $ (realToFrac :: Int -> Float) $ minimum $ (result_zero :) $ if isOneKind then [] else map snd $ filter ((0<=).fst) $  concat array_result
    