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