import std;
import core.bitop;

ulong MAX = 100_100, MOD = 1_000_000_007, INF = 1_000_000_000_000;
alias sread = () => readln.chomp();
alias lread(T = long) = () => readln.chomp.to!(T);
alias aryread(T = long) = () => readln.split.to!(T[]);
alias Pair = Tuple!(long, "x", long, "y");
alias PQueue(T, alias less = "a>b") = BinaryHeap!(Array!T, less);

void main()
{
    long n = lread();
    auto open = new long[](n);
    auto close = new long[](n);
    foreach (i; iota(n))
    {
        long a, b;
        scan(a, b);
        open[i] = a;
        close[i] = b;
    }
    open.sort();
    close.sort();
    if (n % 2)
        writeln(close[n / 2] - open[n / 2] + 1);
    else
        writeln((close[n / 2] + close[n / 2 - 1]) - (open[n / 2] + open[n / 2 - 1]) + 1);
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}