using System;
using System.Numerics;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace debug
{
    class main
    {
        static void Main(string[] args)
        {
            //問題クラスを展開
            ProgramE a = new ProgramE();
            a.main();//実行する

        }

    }

    class ProgramA
    {
        public void main()
        {
            //入力
            string[] s = Console.ReadLine().Split(' ');
            int a = int.Parse(s[0]);
            int b = int.Parse(s[1]);

            //時間に換算して起きてる時間からk時間を除く
            Console.WriteLine(a*b);

        }
    }

    class ProgramB
    {
        public void main()
        {
            //入力
            int n = int.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split(' ');
            long ans = 1;
            long[] a = new long[n];
            long INF = 1000000000000000000;

            for (int i = 0; i < n; i++)
                a[i] = long.Parse(s[i]);

            Array.Sort(a);
            for (int i = 0; i < n; i++)
            {
                if (a[i] == 0)
                    break;

                INF /= a[i];
                if(INF == 0)
                {
                    Console.WriteLine("-1");
                    return;
                }

            }

            //?はD、それ以外は普通に出す
            for (int i = 0;i < n;i++)
            {
                ans *= a[i];
            }

            Console.WriteLine(ans);
            

        }
    }

    class ProgramC
    {
        public void main()
        {
            
            string[] s = Console.ReadLine().Split(' ');
            long a = long.Parse(s[0]);
            double b = double.Parse(s[1]);

            if(s[0].Length < 3)
            {
                Console.WriteLine((long)(a * b));
                return;
            }

            long ans = 0;
            for(int i = 0;i < s[0].Length - 2;i++)
            {
                long temp = (s[0][i] - '0') * (long)Math.Pow(10, s[0].Length - i - 1);
                ans += (long)(temp * b);

            }

            double ans2 = ( (s[0][s[0].Length - 2] - '0') * 10  + (s[0][s[0].Length - 1] - '0')) * b;


            Console.WriteLine(ans + (long)ans2);
        }
    }

    class ProgramD
    {
        public void main()
        {

            long n = long.Parse(Console.ReadLine());
            long temp = n;
            long ans = 0;
            List<long> sosu = new List<long>();

            for(int i = 2; i <= Math.Sqrt(n);i++)
            {

                if(temp % i == 0)
                {
                    int count = 0;
                    int count2 = 1;
                    int ans_temp = 1;
                    while (temp % i == 0)
                    {
                        count++;
                        temp /= i;
                        if (ans_temp == count)
                        {
                            count2++;
                            ans_temp += count2;
                            ans++;
                        }
                    }
                }
            }

            if (temp > Math.Sqrt(n))
                ans++;


            Console.WriteLine(ans);
        }
    }

    class ProgramE
    {
        public void main()
        {

            long n = long.Parse(Console.ReadLine());
            long[] a = new long[n];
            long[] b = new long[n];

            for (int i = 0; i < n; i++)
            {
                string[] s = Console.ReadLine().Split(' ');
                a[i] = long.Parse(s[0]);
                b[i] = long.Parse(s[1]);
            }

            Array.Sort(a);
            Array.Sort(b);

            long min = 0;
            long max = 0;

            if (n % 2 == 0)
            {
                min = a[n / 2] + a[n / 2 - 1];
                max = b[n / 2] + b[n / 2 - 1];

            }
            else
            {
                min = a[n / 2];
                max = b[n / 2];
            }
            


            Console.WriteLine(max - min + 1);
        }
    }
}






Measured memory_bytes: 43524