//#pragma GCC optimize("O3")
//#pragma GCC target("avx2")
// 293206GT
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <unordered_set>
#include <stack>
#include <string>
#include<algorithm>
#include <random>
#include <bitset>
#include <chrono>

typedef long long ll;

using namespace std;
#define put(a) cout << (a) << '\n'
#define sqr(x) (x) * (x)
typedef pair<ll, ll> pii;
typedef long double ld;
#define double long double
typedef pair<ld, ld> pld;
#define rep(x, y, a) for (int x = (y); x < (int)(a); ++x)
#define all(a) a.begin(), a.end()
#define chkmax(a, b) a = max(a, (b))
#define chkmin(a, b) a = min(a, (b))
#define prev asasdasd
#define next aasdasda
#define left asdasdasdasd
#define right asnabsdkasdl
#define rank asdasdknlasd
#define move asdasdas

typedef vector<ll> vi;
typedef vector<pii> vpii;
namespace IO {
    template<class A, class B>
    ostream &operator<<(ostream &out, pair<A, B> &a) {
        out << a.first << " " << a.second;
        return out;
    }

    template<class A, class B>
    ostream &operator<<(ostream &out, vector<pair<A, B>> &a) {
        for (pair<A, B> x: a)
            out << x.first << " " << x.second << '\n';
        return out;
    }

    template<class A>
    ostream &operator<<(ostream &out, vector<A> &a) {
        for (A x: a) out << x << ' ';
        return out;
    }

    template<class A, class B>
    istream &operator>>(istream &in, pair<A, B> &a) {
        in >> a.first >> a.second;
        return in;
    }

    template<class A>
    istream &operator>>(istream &in, vector<A> &a) {
        for (A &x: a) in >> x;
        return in;
    }
}
using namespace IO;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define int ll

void solve() {
    int n;
    cin >> n;
    vpii a(n);
    cin >> a;
    sort(all(a));
    if (n % 2 == 1) {
        vi beg(n), end(n);
        rep(i, 0, n) tie(beg[i], end[i]) = a[i];
        sort(all(end));
        int beg1 = beg[n / 2];
        int end1 = end[n / 2];
//        int cur_beg = -1;
//        int cnt = 0;
//        vpii evs;
//        rep(i, 0, n) {
//            evs.push_back({max(a[i].first, beg1), -1});
//            evs.push_back({min(a[i].second, end1), 1});
//        }
//        int res = 0;
//        sort(all(evs));
//        for (pii x: evs) {
//            if (x.first > end1)break;
//            if (cnt == 0) {
//                cur_beg = x.first;
//            }
//            cnt -= x.second;
//            if (cnt == 0) {
//                res += x.first - cur_beg + 1;
//            }
//        }
        put(end1-beg1 + 1);
        return;
    }
    vi beg(n), end(n);
    rep(i, 0, n) tie(beg[i], end[i]) = a[i];
    sort(all(end));
    int beg1 = beg[n / 2-1] + beg[n / 2];
    int end1 = end[n / 2]+end[n / 2 - 1];
//    int cur_beg = -1;
//    int cnt = 0;
//    vpii evs;
//    rep(i, 0, n) {
//        evs.push_back({max(a[i].first*2, beg1), -1});
//        evs.push_back({min(a[i].second*2, end1), 1});
//    }
//    int res = 0;
//    sort(all(evs));
//    for (pii x: evs) {
//        if (x.first > end1)break;
//        if (cnt == 0) {
//            cur_beg = x.first;
//        }
//        cnt -= x.second;
//        if (cnt == 0) {
//            res += x.first - cur_beg + 1;
//        }
//    }
    put(end1-beg1+1);
    return;
}


signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout.precision(30);
//    freopen("input.txt", "r", stdin);
//    freopen("input.txt", "r", stdin);
    int q = 1;
//    cin >> q;
    while (q--) solve();
}



Measured memory_bytes: 9520