n = int(input())
array = list(map(int, input().split()))
count = 0

for i in range(n):
    flag = 0
    minj = i
    for j in range(i, n):
        if array[j] < array[minj]:
            flag = 1
            minj = j

    if flag == 1:
        count += 1
    array[minj], array[i] = array[i], array[minj]


print(*array)
print(count)
 n = int(input()) n int(input()) int input() input array = list(map(int, input().split())) array list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split count = 0 count 0 for i in range(n):
    flag = 0
    minj = i
    for j in range(i, n):
        if array[j] < array[minj]:
            flag = 1
            minj = j

    if flag == 1:
        count += 1
    array[minj], array[i] = array[i], array[minj] i range(n) range n flag = 0 flag 0 minj = i minj i for j in range(i, n):
        if array[j] < array[minj]:
            flag = 1
            minj = j

     j range(i, n) range i n if array[j] < array[minj]:
            flag = 1
            minj = j

     array[j] < array[minj] array[j] array j array[minj] array minj flag = 1 flag 1 minj = j minj j if flag == 1:
        count += 1
     flag == 1 flag 1 count += 1 count 1 array[minj], array[i] = array[i], array[minj] array[minj] array minj array[i] array i array[i] array i array[minj] array minj print(*array) print *array array print(count) print count count += 1 1 count count = 0 0 count n = int(input()) int(input()) n minj = i i minj flag = 0 0 flag array = list(map(int, input().split())) list(map(int, input().split())) array minj = j j minj flag = 1 1 flag
n = int(input())
array = list(map(int, input().split()))
count = 0

for i in range(n):
    flag = 0
    minj = i
    for j in range(i, n):
        if array[j] < array[minj]:
            flag = 1
            minj = j

    if flag == 1:
        count += 1
    array[minj], array[i] = array[i], array[minj]


print(*array)
print(count)

