n=int(input())
l=list(map(int,input().split()))

count=0
for i in range(n):
    m=i
    for j in range(i,n):
        if l[j]<l[m]:
            m=j
    l[i],l[m]=l[m],l[i]
    if l[i]!=l[m]:
        count+=1
print(*l)
print(count) n=int(input()) n int(input()) int input() input l=list(map(int,input().split())) l list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split count=0 count 0 for i in range(n):
    m=i
    for j in range(i,n):
        if l[j]<l[m]:
            m=j
    l[i],l[m]=l[m],l[i]
    if l[i]!=l[m]:
        count+=1 i range(n) range n m=i m i for j in range(i,n):
        if l[j]<l[m]:
            m=j
     j range(i,n) range i n if l[j]<l[m]:
            m=j
     l[j]<l[m] l[j] l j l[m] l m m=j m j l[i],l[m]=l[m],l[i] l[i] l i l[m] l m l[m] l m l[i] l i if l[i]!=l[m]:
        count+=1 l[i]!=l[m] l[i] l i l[m] l m count+=1 count 1 print(*l) print *l l print(count) print count l=list(map(int,input().split())) list(map(int,input().split())) l n=int(input()) int(input()) n m=j j m count+=1 1 count m=i i m count=0 0 count
n=int(input())
l=list(map(int,input().split()))

count=0
for i in range(n):
    m=i
    for j in range(i,n):
        if l[j]<l[m]:
            m=j
    l[i],l[m]=l[m],l[i]
    if l[i]!=l[m]:
        count+=1
print(*l)
print(count)
