import Data.List

main = do
  li <- getLine
  let n = read li
  co <- getContents
  let [as,bs] = transpose $ map (map read . words) $ lines co
  let ans = compute n as bs
  print ans

-- pureforeverearthのコード
-- https://atcoder.jp/contests/abc169/submissions/13847654
-- をコピーしたもの。これで答えが求まる理屈は理解できていない

compute :: Int -> [Int] -> [Int] -> Int
compute n as bs
  | odd n = bs1 !! 1 - as1 !! 1 + 1
  | True  = bs1 !! 0 + bs1 !! 1 - as1 !! 0 - as1 !! 1 + 1
  where
    as1 = drop n21 $ sort as
    bs1 = drop n21 $ sort bs
    n21 = pred $ div n 2