There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take.

Constraints

* 2 \leq N \leq 2 \times 10^5
* 1 \leq A_i \leq B_i \leq 10^9
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


N
A_1 B_1
A_2 B_2
:
A_N B_N


Output

Print the answer.

Examples

Input

2
1 2
2 3


Output

3


Input

3
100 100
10 10000
1 1000000000


Output

9991

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Comparator;
import java.util.List;
import java.util.StringTokenizer;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {
    public static void main(final String[] args) {
        final FastScanner scanner = new FastScanner(System.in);
        final int n = scanner.nextInt();
        final List<Pair> list = IntStream.range(0, n)
            .mapToObj(i -> new Pair(scanner.nextInt(), scanner.nextInt()))
            .collect(Collectors.toList());

        final List<Integer> aSortedList = list.stream()
            .map(pair -> pair.a)
            .sorted()
            .collect(Collectors.toList());

        final List<Integer> bSortedList = list.stream()
            .map(pair -> pair.b)
            .sorted(Comparator.reverseOrder())
            .collect(Collectors.toList());

        if (n % 2 == 1) {
            System.out.println(bSortedList.get(n / 2) - aSortedList.get(n / 2) + 1);
            return;
        }

        final int a = (n - 1) / 2;
        final int b = n / 2;
        final double formerBegin = aSortedList.get(a);
        final double formerEnd = bSortedList.get(b);
        final double latterBegin = aSortedList.get(b);
        final double latterEnd = bSortedList.get(a);

        final double begin = (formerBegin + latterBegin) / 2;
        final double end = (formerEnd + latterEnd) / 2;
        System.out.println((int) ((end - begin) * 2 + 1));
    }

    private static class Pair {
        final int a;
        final int b;

        Pair(final int a, final int b) {
            this.a = a;
            this.b = b;
        }
    }

    private static class FastScanner {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(final InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (final IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (final IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return tokenizer.nextToken("\n");
        }
    }
}
