#include <bits/stdc++.h>
using namespace std;
int MAX = 100;
int SelectionSort(int A[], int N);
void trace(int A[], int N);
int main(int argc, char const *argv[]) {
  int A[100], N;
  cin >> N;
  for (int i = 0; i < N; i++) cin >> A[i];
  int count = SelectionSort(A, N);
  trace(A, N);
  cout << count << endl;
  return 0;
}
int SelectionSort(int A[], int N) {
  int count = 0;
  for (int i = 0; i < N; i++) {
    int minj = i;
    for (int j = i + 1; j < N; j++) {
      if (A[j] < A[minj]) {
        minj = j;
      }
    }
    swap(A[i], A[minj]);
    count++;
  }
  return count;
}
void trace(int A[], int N) {
  for (int i = 0; i < N; i++) {
    if (i > 0) {
      cout << ' ';
    }
    cout << A[i];
  }
  cout << endl;
}
