n = int(input())
a = [int(s) for s in input().split(" ")]
cnt = 0

for i in range(n):
    mi = min(a[i:])
    if a[i] > mi:
        j = a[i:].index(mi)+i
        a[i], a[j] = a[j], a[i]
        cnt += 1

print(" ".join([str(i) for i in a]))
print(cnt) n = int(input()) n int(input()) int input() input int(s) for s in input().split(" ") for s in input().split(" ") s input().split(" ") ().split () input split " " for s in input().split(" ") int(s) int s a = [int(s) for s in input().split(" ")] a [int(s) for s in input().split(" ")] cnt = 0 cnt 0 for i in range(n):
    mi = min(a[i:])
    if a[i] > mi:
        j = a[i:].index(mi)+i
        a[i], a[j] = a[j], a[i]
        cnt += 1 i range(n) range n mi = min(a[i:]) mi min(a[i:]) min a[i:] a i: i if a[i] > mi:
        j = a[i:].index(mi)+i
        a[i], a[j] = a[j], a[i]
        cnt += 1 a[i] > mi a[i] a i mi j = a[i:].index(mi)+i j a[i:].index(mi)+i a[i:].index(mi) [i:].index [i:] a i: i index mi i a[i], a[j] = a[j], a[i] a[i] a i a[j] a j a[j] a j a[i] a i cnt += 1 cnt 1 str(i) for i in a for i in a i a for i in a str(i) str i print(" ".join([str(i) for i in a])) print " ".join([str(i) for i in a]) " ".join " " join [str(i) for i in a] print(cnt) print cnt cnt = 0 0 cnt j = a[i:].index(mi)+i a[i:].index(mi)+i j a = [int(s) for s in input().split(" ")] [int(s) for s in input().split(" ")] a n = int(input()) int(input()) n mi = min(a[i:]) min(a[i:]) mi cnt += 1 1 cnt
n = int(input())
a = [int(s) for s in input().split(" ")]
cnt = 0

for i in range(n):
    mi = min(a[i:])
    if a[i] > mi:
        j = a[i:].index(mi)+i
        a[i], a[j] = a[j], a[i]
        cnt += 1

print(" ".join([str(i) for i in a]))
print(cnt)