N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(N-1):
    min_i = i
    for j in range(i+1, N):
        if A[j] < A[min_i]:
            min_i = j
    if i != min_i:
        ans += 1
        A[i], A[min_i] = A[min_i], A[i]
print(*A)
print(ans)
 N = int(input()) N int(input()) int input() input A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = 0 ans 0 for i in range(N-1):
    min_i = i
    for j in range(i+1, N):
        if A[j] < A[min_i]:
            min_i = j
    if i != min_i:
        ans += 1
        A[i], A[min_i] = A[min_i], A[i] i range(N-1) range N-1 N 1 min_i = i min_i i for j in range(i+1, N):
        if A[j] < A[min_i]:
            min_i = j
     j range(i+1, N) range i+1 i 1 N if A[j] < A[min_i]:
            min_i = j
     A[j] < A[min_i] A[j] A j A[min_i] A min_i min_i = j min_i j if i != min_i:
        ans += 1
        A[i], A[min_i] = A[min_i], A[i] i != min_i i min_i ans += 1 ans 1 A[i], A[min_i] = A[min_i], A[i] A[i] A i A[min_i] A min_i A[min_i] A min_i A[i] A i print(*A) print *A A print(ans) print ans min_i = i i min_i N = int(input()) int(input()) N ans += 1 1 ans A = list(map(int, input().split())) list(map(int, input().split())) A ans = 0 0 ans min_i = j j min_i
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(N-1):
    min_i = i
    for j in range(i+1, N):
        if A[j] < A[min_i]:
            min_i = j
    if i != min_i:
        ans += 1
        A[i], A[min_i] = A[min_i], A[i]
print(*A)
print(ans)

