def main():

    n = int(eval(input()))

    al = []

    bl = []

    for _ in range(n):

        a, b = list(map(int, input().split()))

        al.append(a)

        bl.append(b)

    als = list(sorted(al))

    bls = list(sorted(bl))

    if n%2:

        print((bls[n//2]-als[n//2]+1))

    else:

        print((bls[n//2-1]+bls[n//2]-als[n//2]-als[n//2-1]+1))



if __name__ == "__main__":

    main()
def main():

    n = int(eval(input()))

    al = []

    bl = []

    for _ in range(n):

        a, b = list(map(int, input().split()))

        al.append(a)

        bl.append(b)

    al.sort()

    bl.sort()

    if n%2:

        print((bl[n//2]-al[n//2]+1))

    else:

        print((bl[n//2]+bl[n//2-1]-al[n//2]-al[n//2-1]+1))



if __name__ == "__main__":

    main()
def main():
    n = int(eval(input()))
    al = []
    bl = []
    for _ in range(n):
        a, b = list(map(int, input().split()))
        al.append(a)
        bl.append(b)
    als = list(sorted(al))
    bls = list(sorted(bl))
    if n % 2:
        print((bls[n // 2] - als[n // 2] + 1))
    else:
        print((bls[n // 2 - 1] + bls[n // 2] - als[n // 2] - als[n // 2 - 1] + 1))


if __name__ == "__main__":
    main()

def main():
    n = int(eval(input()))
    al = []
    bl = []
    for _ in range(n):
        a, b = list(map(int, input().split()))
        al.append(a)
        bl.append(b)
    al.sort()
    bl.sort()
    if n % 2:
        print((bl[n // 2] - al[n // 2] + 1))
    else:
        print((bl[n // 2] + bl[n // 2 - 1] - al[n // 2] - al[n // 2 - 1] + 1))


if __name__ == "__main__":
    main()

-    als = list(sorted(al)) -    bls = list(sorted(bl)) +    al.sort() +    bl.sort() -        print((bls[n // 2] - als[n // 2] + 1)) +        print((bl[n // 2] - al[n // 2] + 1)) -        print((bls[n // 2 - 1] + bls[n // 2] - als[n // 2] - als[n // 2 - 1] + 1)) +        print((bl[n // 2] + bl[n // 2 - 1] - al[n // 2] - al[n // 2 - 1] + 1))