#include<streamio>
#include<algorithm>
 
int selectionSort(int A[], int N) {
  int sw = 0;
  for ( int i = 0; i < N; i++){
    minj = i;
    for ( int j = i; j < N - 1; j++){
      if (A[j] < A[minj]) {
        minj = j;
      }
    }
    std::swap(A[minj], A[i]);
    sw++;
  }
  return sw;
}
 
int main() {
  int sw, N, A[100];
  cin >> N;
   
  for ( int i = 0; i < N; i++) cin >> A[i];
   
  sw = selectionSort(A, N);
 
  for ( int i = 0; i < N; i++) {
    if (i) cout << " ";
    cout << A[i];
  }
  cout << endl;
  cout << sw << endl;
 
  return 0;
}
