#include <bits/stdc++.h>
using namespace std;
class SelectionSort {
 public:
  int A[100], sw = 0;
  void Sort(int A[], int N) {
    int minj;
    for (int i = 0; i < N; i++) {
      minj = i;
      for (int j = i; j < N; j++) {
        if (A[j] < A[minj]) {
          minj = j;
          swap(A[i], A[minj]);
          sw++;
        }
      }
    }
  }
  void Print(int A[], int N) {
    for (int i = 0; i < N; i++) {
      if (i) {
        cout << " ";
      }
      cout << A[i];
    }
    cout << sw;
  }
};
int main() {
  int A[100], N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  SelectionSort ss;
  ss.Sort(A, N);
  ss.Print(A, N);
}
