n = int(input())
s = [ i for i in input().split()]
cnt = 0
for i in range(n-1):
    minj = i
    for j in range(i+1,n):
        if int(s[j]) < int(s[minj]):
            minj = j
    if i != minj:
        cnt += 1
        s[i],s[minj] = s[minj],s[i]
print(' '.join(s))
print(cnt)
 n = int(input()) n int(input()) int input() input i for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() i s = [ i for i in input().split()] s [ i for i in input().split()] cnt = 0 cnt 0 for i in range(n-1):
    minj = i
    for j in range(i+1,n):
        if int(s[j]) < int(s[minj]):
            minj = j
    if i != minj:
        cnt += 1
        s[i],s[minj] = s[minj],s[i] i range(n-1) range n-1 n 1 minj = i minj i for j in range(i+1,n):
        if int(s[j]) < int(s[minj]):
            minj = j
     j range(i+1,n) range i+1 i 1 n if int(s[j]) < int(s[minj]):
            minj = j
     int(s[j]) < int(s[minj]) int(s[j]) int s[j] s j int(s[minj]) int s[minj] s minj minj = j minj j if i != minj:
        cnt += 1
        s[i],s[minj] = s[minj],s[i] i != minj i minj cnt += 1 cnt 1 s[i],s[minj] = s[minj],s[i] s[i] s i s[minj] s minj s[minj] s minj s[i] s i print(' '.join(s)) print ' '.join(s) ' '.join ' ' join s print(cnt) print cnt minj = i i minj minj = j j minj s = [ i for i in input().split()] [ i for i in input().split()] s cnt = 0 0 cnt cnt += 1 1 cnt n = int(input()) int(input()) n
n = int(input())
s = [ i for i in input().split()]
cnt = 0
for i in range(n-1):
    minj = i
    for j in range(i+1,n):
        if int(s[j]) < int(s[minj]):
            minj = j
    if i != minj:
        cnt += 1
        s[i],s[minj] = s[minj],s[i]
print(' '.join(s))
print(cnt)

