#include <bits/stdc++.h>
using namespace std;
int selectionSort(int *, int);
void trace(int *, int);
int main() {
  int N;
  int i;
  int sw;
  int A[100];
  cin >> N;
  for (i = 0; i < N; i++) {
    cin >> A[i];
  }
  sw = selectionSort(A, N);
  trace(A, N);
  cout << endl;
  cout << sw;
  cout << endl;
}
int selectionSort(int *A, int N) {
  int i;
  int minj;
  int j;
  int tmp;
  int sw = 0;
  for (i = 0; i < N - 1; i++) {
    minj = i;
    for (j = i; j < N; j++) {
      if (A[j] < A[minj]) {
        minj = j;
      }
    }
    tmp = A[i];
    A[i] = A[minj];
    A[minj] = tmp;
    sw++;
  }
  return sw;
}
void trace(int *A, int N) {
  int i;
  for (i = 0; i < N; i++) {
    if (i) {
      cout << " ";
    }
    cout << A[i];
  }
}
