n = int(input())
a = [int(x) for x in input().split()]

c = 0

for i in range(n - 1):
    minj = i
    for j in range(i + 1, n):
        if a[j] < a[minj]:
            minj = j
    if minj != i:
        tmp = a[i]
        a[i] = a[minj]
        a[minj] = tmp
        c += 1

print(" ".join([str(x) for x in a]))
print(c) n = int(input()) n int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x a = [int(x) for x in input().split()] a [int(x) for x in input().split()] c = 0 c 0 for i in range(n - 1):
    minj = i
    for j in range(i + 1, n):
        if a[j] < a[minj]:
            minj = j
    if minj != i:
        tmp = a[i]
        a[i] = a[minj]
        a[minj] = tmp
        c += 1 i range(n - 1) range n - 1 n 1 minj = i minj i for j in range(i + 1, n):
        if a[j] < a[minj]:
            minj = j
     j range(i + 1, n) range i + 1 i 1 n if a[j] < a[minj]:
            minj = j
     a[j] < a[minj] a[j] a j a[minj] a minj minj = j minj j if minj != i:
        tmp = a[i]
        a[i] = a[minj]
        a[minj] = tmp
        c += 1 minj != i minj i tmp = a[i] tmp a[i] a i a[i] = a[minj] a[i] a i a[minj] a minj a[minj] = tmp a[minj] a minj tmp c += 1 c 1 str(x) for x in a for x in a x a for x in a str(x) str x print(" ".join([str(x) for x in a])) print " ".join([str(x) for x in a]) " ".join " " join [str(x) for x in a] print(c) print c minj = j j minj n = int(input()) int(input()) n c = 0 0 c minj = i i minj tmp = a[i] a[i] tmp a = [int(x) for x in input().split()] [int(x) for x in input().split()] a c += 1 1 c
n = int(input())
a = [int(x) for x in input().split()]

c = 0

for i in range(n - 1):
    minj = i
    for j in range(i + 1, n):
        if a[j] < a[minj]:
            minj = j
    if minj != i:
        tmp = a[i]
        a[i] = a[minj]
        a[minj] = tmp
        c += 1

print(" ".join([str(x) for x in a]))
print(c)