n = int(input())
num = list(map(int, input().split()))
count = 0
for i in range(0, n):
    minj = i
    a = 0
    for j in range(i + 1, n):
        if num[minj] > num[j]:
            minj = j
    if minj != i:
        count += 1
    a = num[minj]
    num[minj] = num[i]
    num[i] = a
print(' '.join(list(map(str, num))))
print(count)

032dfe078bb3f203105df802516b4e66ec80d4d9
<mask token>

<mask token>
for i in range(0, n):
    minj = i
    a = 0
    for j in range(i + 1, n):
        if num[minj] > num[j]:
            minj = j
    if minj != i:
        count += 1
    a = num[minj]
    num[minj] = num[i]
    num[i] = a
print(' '.join(list(map(str, num))))
print(count)

n = int(input())
num = list(map(int, input().split()))
count = 0
for i in range(0, n):
    minj = i
    a = 0
    for j in range(i + 1, n):
        if num[minj] > num[j]:
            minj = j
    if minj != i:
        count += 1
    a = num[minj]
    num[minj] = num[i]
    num[i] = a
print(' '.join(list(map(str, num))))
print(count)
