n = int(raw_input())

s = raw_input()

count = 0

num_list= s.split(" ")
for i in range(n):
    num_list[i] = int(num_list[i])

for i in range(n):
    minj = i
    for j in range(i, n):
        if num_list[j] < num_list[minj]:
            minj = j
    num_list[i], num_list[minj] = num_list[minj], num_list[i]
    if i != minj:
        count += 1

print " ".join([str(a) for a in num_list])
print count n = int(raw_input()) n int(raw_input()) int raw_input() raw_input s = raw_input() s raw_input() raw_input count = 0 count 0 num_list= s.split(" ") num_list s.split(" ") s.split s split " " for i in range(n):
    num_list[i] = int(num_list[i]) i range(n) range n num_list[i] = int(num_list[i]) num_list[i] num_list i int(num_list[i]) int num_list[i] num_list i for i in range(n):
    minj = i
    for j in range(i, n):
        if num_list[j] < num_list[minj]:
            minj = j
    num_list[i], num_list[minj] = num_list[minj], num_list[i]
    if i != minj:
        count += 1 i range(n) range n minj = i minj i for j in range(i, n):
        if num_list[j] < num_list[minj]:
            minj = j
     j range(i, n) range i n if num_list[j] < num_list[minj]:
            minj = j
     num_list[j] < num_list[minj] num_list[j] num_list j num_list[minj] num_list minj minj = j minj j num_list[i], num_list[minj] = num_list[minj], num_list[i] num_list[i] num_list i num_list[minj] num_list minj num_list[minj] num_list minj num_list[i] num_list i if i != minj:
        count += 1 i != minj i minj count += 1 count 1 print str(a) for a in num_list for a in num_list a num_list for a in num_list str(a) str a " ".join([str(a) for a in num_list]) " ".join " " join [str(a) for a in num_list] print s = raw_input() raw_input() s minj = i i minj minj = j j minj num_list= s.split(" ") s.split(" ") num_list count = 0 0 count count += 1 1 count n = int(raw_input()) int(raw_input()) n
n = int(raw_input())

s = raw_input()

count = 0

num_list= s.split(" ")
for i in range(n):
    num_list[i] = int(num_list[i])

for i in range(n):
    minj = i
    for j in range(i, n):
        if num_list[j] < num_list[minj]:
            minj = j
    num_list[i], num_list[minj] = num_list[minj], num_list[i]
    if i != minj:
        count += 1

print " ".join([str(a) for a in num_list])
print count