def selections(N):
    count = 0
    for i in range(len(N)):
        mini = i
        for j in range(i+1, len(N)):
            if N[mini] > N[j]:
                mini = j
        if i != mini:
            N[mini], N[i] = N[i], N[mini]
            count += 1
    c = 1
    for i in N:
        print(i, end='')
        if c < len(N):
            print(' ', end='')
            c += 1
    print('')
    print(count)
    
n = int(input())
numbers = list(map(int, input().split()))

selections(numbers) def selections(N):
    count = 0
    for i in range(len(N)):
        mini = i
        for j in range(i+1, len(N)):
            if N[mini] > N[j]:
                mini = j
        if i != mini:
            N[mini], N[i] = N[i], N[mini]
            count += 1
    c = 1
    for i in N:
        print(i, end='')
        if c < len(N):
            print(' ', end='')
            c += 1
    print('')
    print(count)
     selections count = 0 count 0 for i in range(len(N)):
        mini = i
        for j in range(i+1, len(N)):
            if N[mini] > N[j]:
                mini = j
        if i != mini:
            N[mini], N[i] = N[i], N[mini]
            count += 1
     i range(len(N)) range len(N) len N mini = i mini i for j in range(i+1, len(N)):
            if N[mini] > N[j]:
                mini = j
         j range(i+1, len(N)) range i+1 i 1 len(N) len N if N[mini] > N[j]:
                mini = j
         N[mini] > N[j] N[mini] N mini N[j] N j mini = j mini j if i != mini:
            N[mini], N[i] = N[i], N[mini]
            count += 1
     i != mini i mini N[mini], N[i] = N[i], N[mini] N[mini] N mini N[i] N i N[i] N i N[mini] N mini count += 1 count 1 c = 1 c 1 for i in N:
        print(i, end='')
        if c < len(N):
            print(' ', end='')
            c += 1
     i N print(i, end='') print i end='' end '' if c < len(N):
            print(' ', end='')
            c += 1
     c < len(N) c len(N) len N print(' ', end='') print ' ' end='' end '' c += 1 c 1 print('') print '' print(count) print count N N n = int(input()) n int(input()) int input() input numbers = list(map(int, input().split())) numbers list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split selections(numbers) selections numbers def selections(N):
    count = 0
    for i in range(len(N)):
        mini = i
        for j in range(i+1, len(N)):
            if N[mini] > N[j]:
                mini = j
        if i != mini:
            N[mini], N[i] = N[i], N[mini]
            count += 1
    c = 1
    for i in N:
        print(i, end='')
        if c < len(N):
            print(' ', end='')
            c += 1
    print('')
    print(count)
     def selections(N):
    count = 0
    for i in range(len(N)):
        mini = i
        for j in range(i+1, len(N)):
            if N[mini] > N[j]:
                mini = j
        if i != mini:
            N[mini], N[i] = N[i], N[mini]
            count += 1
    c = 1
    for i in N:
        print(i, end='')
        if c < len(N):
            print(' ', end='')
            c += 1
    print('')
    print(count)
     selections numbers = list(map(int, input().split())) list(map(int, input().split())) numbers n = int(input()) int(input()) n
def selections(N):
    count = 0
    for i in range(len(N)):
        mini = i
        for j in range(i+1, len(N)):
            if N[mini] > N[j]:
                mini = j
        if i != mini:
            N[mini], N[i] = N[i], N[mini]
            count += 1
    c = 1
    for i in N:
        print(i, end='')
        if c < len(N):
            print(' ', end='')
            c += 1
    print('')
    print(count)
    
n = int(input())
numbers = list(map(int, input().split()))

selections(numbers)