#!/usr/bin/env python
#-*- coding: utf-8 -*-

if __name__ == '__main__':
    N = int(raw_input())
    l = map(int, raw_input().split())
    cnt = 0
    for i in range(0, N):
        minj = i
        for j in range(i, N):
            if l[j] < l[minj]:
                minj = j
        if i != minj:
            l[i], l[minj] = l[minj], l[i]
            cnt += 1
    print ' '.join(map(str, l))
    print cnt if __name__ == '__main__':
    N = int(raw_input())
    l = map(int, raw_input().split())
    cnt = 0
    for i in range(0, N):
        minj = i
        for j in range(i, N):
            if l[j] < l[minj]:
                minj = j
        if i != minj:
            l[i], l[minj] = l[minj], l[i]
            cnt += 1
    print ' '.join(map(str, l))
    print cnt __name__ == '__main__' __name__ '__main__' N = int(raw_input()) N int(raw_input()) int raw_input() raw_input l = map(int, raw_input().split()) l map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split cnt = 0 cnt 0 for i in range(0, N):
        minj = i
        for j in range(i, N):
            if l[j] < l[minj]:
                minj = j
        if i != minj:
            l[i], l[minj] = l[minj], l[i]
            cnt += 1
     i range(0, N) range 0 N minj = i minj i for j in range(i, N):
            if l[j] < l[minj]:
                minj = j
         j range(i, N) range i N if l[j] < l[minj]:
                minj = j
         l[j] < l[minj] l[j] l j l[minj] l minj minj = j minj j if i != minj:
            l[i], l[minj] = l[minj], l[i]
            cnt += 1
     i != minj i minj l[i], l[minj] = l[minj], l[i] l[i] l i l[minj] l minj l[minj] l minj l[i] l i cnt += 1 cnt 1 print ' '.join(map(str, l)) ' '.join ' ' join map(str, l) map str l print minj = i i minj minj = j j minj N = int(raw_input()) int(raw_input()) N l = map(int, raw_input().split()) map(int, raw_input().split()) l cnt = 0 0 cnt cnt += 1 1 cnt
#!/usr/bin/env python
#-*- coding: utf-8 -*-

if __name__ == '__main__':
    N = int(raw_input())
    l = map(int, raw_input().split())
    cnt = 0
    for i in range(0, N):
        minj = i
        for j in range(i, N):
            if l[j] < l[minj]:
                minj = j
        if i != minj:
            l[i], l[minj] = l[minj], l[i]
            cnt += 1
    print ' '.join(map(str, l))
    print cnt
