n = int(input())
nums = list(map(int, input().split()))
count = 0

for i in range(n):
    minj = i

    for j in range(i + 1, n):
#    for j in range(i, n):
        if nums[j] < nums[minj]:
            minj = j
#            count += 1
    else:
        if nums[i] > nums[minj]:
            temp = nums[minj]
            nums[minj] = nums[i]
            nums[i] = temp
            count += 1

print(' '.join([str(i) for i in nums]))
print(count)
 n = int(input()) n int(input()) int input() input nums = list(map(int, input().split())) nums 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):
    minj = i

    for j in range(i + 1, n):
#    for j in range(i, n):
        if nums[j] < nums[minj]:
            minj = j
#            count += 1
    else:
        if nums[i] > nums[minj]:
            temp = nums[minj]
            nums[minj] = nums[i]
            nums[i] = temp
            count += 1 i range(n) range n minj = i minj i for j in range(i + 1, n):
#    for j in range(i, n):
        if nums[j] < nums[minj]:
            minj = j
#            count += 1
    else:
        if nums[i] > nums[minj]:
            temp = nums[minj]
            nums[minj] = nums[i]
            nums[i] = temp
            count += 1 j range(i + 1, n) range i + 1 i 1 n if nums[j] < nums[minj]:
            minj = j
#            count += 1
     nums[j] < nums[minj] nums[j] nums j nums[minj] nums minj minj = j minj j if nums[i] > nums[minj]:
            temp = nums[minj]
            nums[minj] = nums[i]
            nums[i] = temp
            count += 1 nums[i] > nums[minj] nums[i] nums i nums[minj] nums minj temp = nums[minj] temp nums[minj] nums minj nums[minj] = nums[i] nums[minj] nums minj nums[i] nums i nums[i] = temp nums[i] nums i temp count += 1 count 1 str(i) for i in nums for i in nums i nums for i in nums str(i) str i print(' '.join([str(i) for i in nums])) print ' '.join([str(i) for i in nums]) ' '.join ' ' join [str(i) for i in nums] print(count) print count nums = list(map(int, input().split())) list(map(int, input().split())) nums minj = j j minj n = int(input()) int(input()) n count += 1 1 count temp = nums[minj] nums[minj] temp count = 0 0 count minj = i i minj
n = int(input())
nums = list(map(int, input().split()))
count = 0

for i in range(n):
    minj = i

    for j in range(i + 1, n):
#    for j in range(i, n):
        if nums[j] < nums[minj]:
            minj = j
#            count += 1
    else:
        if nums[i] > nums[minj]:
            temp = nums[minj]
            nums[minj] = nums[i]
            nums[i] = temp
            count += 1

print(' '.join([str(i) for i in nums]))
print(count)

