while 1:

    t = eval(input())

    if t ==0: break

    card1 = []

    for i in range(t):

        card1 += [eval(input())]

    t *= 2

    card1 = sorted(card1)

    card2 = list(range(1,t+1))

    for x in card1:

        card2.remove(x)

    ba = 0

    turn = 1

    while 1:

        if len(card1)==0 or len(card2)==0: break

        card = card1 if turn else card2

        cnt = 0

        while cnt < len(card):

            if card[cnt] > ba: break

            cnt+=1

        if cnt != len(card):

            ba = card.pop(cnt); turn = 1 - turn;

        else:

            ba = 0; turn = 1 - turn;

    print(len(card2))

    print(len(card1))
while 1:

    n = eval(input())

    if n == 0: break

    card1 = sorted([eval(input()) for i in range(n)])

    card2 = [i for i in range(1,2*n+1) if i not in card1]

    ba = 0

    turn = 1

    while card1 and card2:

        card = card1 if turn else card2

        for i in range(len(card)):

            if card[i] > ba:

                ba = card.pop(i)

                break

        else:

            ba = 0

        turn ^= 1

    print(len(card2))

    print(len(card1))
while 1:
    t = eval(input())
    if t == 0:
        break
    card1 = []
    for i in range(t):
        card1 += [eval(input())]
    t *= 2
    card1 = sorted(card1)
    card2 = list(range(1, t + 1))
    for x in card1:
        card2.remove(x)
    ba = 0
    turn = 1
    while 1:
        if len(card1) == 0 or len(card2) == 0:
            break
        card = card1 if turn else card2
        cnt = 0
        while cnt < len(card):
            if card[cnt] > ba:
                break
            cnt += 1
        if cnt != len(card):
            ba = card.pop(cnt)
            turn = 1 - turn
        else:
            ba = 0
            turn = 1 - turn
    print(len(card2))
    print(len(card1))

while 1:
    n = eval(input())
    if n == 0:
        break
    card1 = sorted([eval(input()) for i in range(n)])
    card2 = [i for i in range(1, 2 * n + 1) if i not in card1]
    ba = 0
    turn = 1
    while card1 and card2:
        card = card1 if turn else card2
        for i in range(len(card)):
            if card[i] > ba:
                ba = card.pop(i)
                break
        else:
            ba = 0
        turn ^= 1
    print(len(card2))
    print(len(card1))

-    t = eval(input()) -    if t == 0: +    n = eval(input()) +    if n == 0: -    card1 = [] -    for i in range(t): -        card1 += [eval(input())] -    t *= 2 -    card1 = sorted(card1) -    card2 = list(range(1, t + 1)) -    for x in card1: -        card2.remove(x) +    card1 = sorted([eval(input()) for i in range(n)]) +    card2 = [i for i in range(1, 2 * n + 1) if i not in card1] -    while 1: -        if len(card1) == 0 or len(card2) == 0: -            break +    while card1 and card2: -        cnt = 0 -        while cnt < len(card): -            if card[cnt] > ba: +        for i in range(len(card)): +            if card[i] > ba: +                ba = card.pop(i) -            cnt += 1 -        if cnt != len(card): -            ba = card.pop(cnt) -            turn = 1 - turn -            turn = 1 - turn +        turn ^= 1