# -*- coding: utf-8 -*-

N = int(input())
A = list(map(int, input().split()))


count = 0
flag = 0
for i in range(N):

    if N == 1:
        break

    minj = i
    for j in range(i, N):
        if A[j] < A[minj]:
            minj = j
            flag = 1

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

    flag = 0


for i in range(N):
    if i == N - 1:
        print("{0}".format(A[i]))
    else:
        print("{0} ".format(A[i]), end="")

print(count) 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 count = 0 count 0 flag = 0 flag 0 for i in range(N):

    if N == 1:
        break

    minj = i
    for j in range(i, N):
        if A[j] < A[minj]:
            minj = j
            flag = 1

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

    flag = 0 i range(N) range N if N == 1:
        break

     N == 1 N 1 break minj = i minj i for j in range(i, N):
        if A[j] < A[minj]:
            minj = j
            flag = 1

     j range(i, N) range i N if A[j] < A[minj]:
            minj = j
            flag = 1

     A[j] < A[minj] A[j] A j A[minj] A minj minj = j minj j flag = 1 flag 1 if flag == 1:
        A[i], A[minj] = A[minj], A[i]
        count += 1

     flag == 1 flag 1 A[i], A[minj] = A[minj], A[i] A[i] A i A[minj] A minj A[minj] A minj A[i] A i count += 1 count 1 flag = 0 flag 0 for i in range(N):
    if i == N - 1:
        print("{0}".format(A[i]))
    else:
        print("{0} ".format(A[i]), end="") i range(N) range N if i == N - 1:
        print("{0}".format(A[i]))
    else:
        print("{0} ".format(A[i]), end="") i == N - 1 i N - 1 N 1 print("{0}".format(A[i])) print "{0}".format(A[i]) "{0}".format "{0}" format A[i] A i print("{0} ".format(A[i]), end="") print "{0} ".format(A[i]) "{0} ".format "{0} " format A[i] A i end="" end "" print(count) print count N = int(input()) int(input()) N count = 0 0 count flag = 0 0 flag flag = 0 0 flag minj = j j minj minj = i i minj count += 1 1 count A = list(map(int, input().split())) list(map(int, input().split())) A flag = 1 1 flag
# -*- coding: utf-8 -*-

N = int(input())
A = list(map(int, input().split()))


count = 0
flag = 0
for i in range(N):

    if N == 1:
        break

    minj = i
    for j in range(i, N):
        if A[j] < A[minj]:
            minj = j
            flag = 1

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

    flag = 0


for i in range(N):
    if i == N - 1:
        print("{0}".format(A[i]))
    else:
        print("{0} ".format(A[i]), end="")

print(count)
