# -*- coding: utf-8 -*-
n = gets.chomp.to_i

a = Array.new(100)

str = gets.chomp
a = str.split.map(&:to_i)

count = 0
for i in 0..(n-1) do
  minj = i
  for j in i..(n-1) do
    minj = j if a[j] < a[minj]
  end
  if a[i] != a[minj] then
    change = a[i]
    a[i] = a[minj]
    a[minj] = change
    count += 1
  end
end

for i in 0..n-1 do
  print a[i]
  print " " if i != n-1
end

print "\n", count, "\n"