input_line = []

while line = ARGF.gets
  input_line << line.chomp
end

N = input_line.shift.to_i
A = input_line.shift.split(" ").map(&:to_i)
count = 0;

for i in 0..(N-1)
  minj = i
  for j in i..(N-1)
    if A[j] < A[minj]
      minj = j
    end
  end
  if A[i] != A[minj]
    tmp  = A[i]
    A[i] = A[minj]
    A[minj] = tmp
    count += 1
  end
end

A.each.with_index(1) do |item,index|
  if index == A.length
    puts item
  else
    print "#{item} "
  end
end
puts count