import Data.List
import qualified Data.ByteString.Char8 as BS
import Data.Char

main = do
  li <- BS.getLine
  let Just (n,_) = BS.readInt li
  co <- BS.getContents
  let [as,bs] = transpose $ map (unfoldr (BS.readInt . BS.dropWhile isSpace)) $ BS.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 = b1 - a1 + 1
  | True  = b0 + b1 - a0 - a1 + 1
  where
    a0:a1:_ = drop n21 $ sort as
    b0:b1:_ = drop n21 $ sort bs
    n21 = pred $ div n 2