import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N,X,C=0;
    int min,minN=0;
    int A[] = new int[100];

    N = scanner.nextInt();

    for(int i=0;i<N;i++){
      A[i] = scanner.nextInt();
    }

    for(int i=0;i<N;i++){
      min = A[i];
      for(int j=i;j<N;j++){
        if(min>A[j]){
          min = A[j];
          minN = j;
        }
      }
      if(min!=A[i]){
        X = A[minN];
        A[minN] = A[i];
        A[i] = X;
        C++;
      }
    }

    for(int i=0;i<N;i++){
      System.out.print(A[i]);
      if(i!=N-1){
        System.out.print(" ");
      }
    }
    System.out.print("\n");
    System.out.println(C);

  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N,X,C=0;
    int min,minN=0;
    int A[] = new int[100];

    N = scanner.nextInt();

    for(int i=0;i<N;i++){
      A[i] = scanner.nextInt();
    }

    for(int i=0;i<N;i++){
      min = A[i];
      for(int j=i;j<N;j++){
        if(min>A[j]){
          min = A[j];
          minN = j;
        }
      }
      if(min!=A[i]){
        X = A[minN];
        A[minN] = A[i];
        A[i] = X;
        C++;
      }
    }

    for(int i=0;i<N;i++){
      System.out.print(A[i]);
      if(i!=N-1){
        System.out.print(" ");
      }
    }
    System.out.print("\n");
    System.out.println(C);

  }
} Main public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N,X,C=0;
    int min,minN=0;
    int A[] = new int[100];

    N = scanner.nextInt();

    for(int i=0;i<N;i++){
      A[i] = scanner.nextInt();
    }

    for(int i=0;i<N;i++){
      min = A[i];
      for(int j=i;j<N;j++){
        if(min>A[j]){
          min = A[j];
          minN = j;
        }
      }
      if(min!=A[i]){
        X = A[minN];
        A[minN] = A[i];
        A[i] = X;
        C++;
      }
    }

    for(int i=0;i<N;i++){
      System.out.print(A[i]);
      if(i!=N-1){
        System.out.print(" ");
      }
    }
    System.out.print("\n");
    System.out.println(C);

  } main {
    Scanner scanner = new Scanner(System.in);
    int N,X,C=0;
    int min,minN=0;
    int A[] = new int[100];

    N = scanner.nextInt();

    for(int i=0;i<N;i++){
      A[i] = scanner.nextInt();
    }

    for(int i=0;i<N;i++){
      min = A[i];
      for(int j=i;j<N;j++){
        if(min>A[j]){
          min = A[j];
          minN = j;
        }
      }
      if(min!=A[i]){
        X = A[minN];
        A[minN] = A[i];
        A[i] = X;
        C++;
      }
    }

    for(int i=0;i<N;i++){
      System.out.print(A[i]);
      if(i!=N-1){
        System.out.print(" ");
      }
    }
    System.out.print("\n");
    System.out.println(C);

  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N N X X C=0; C 0 int min min minN=0; minN 0 int A[] = new int[100]; A new int[100] 100 N = scanner.nextInt() N scanner.nextInt() scanner.nextInt scanner for(int i=0;i<N;i++){
      A[i] = scanner.nextInt();
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      A[i] = scanner.nextInt();
    } {
      A[i] = scanner.nextInt();
    } A[i] = scanner.nextInt() A[i] A i scanner.nextInt() scanner.nextInt scanner for(int i=0;i<N;i++){
      min = A[i];
      for(int j=i;j<N;j++){
        if(min>A[j]){
          min = A[j];
          minN = j;
        }
      }
      if(min!=A[i]){
        X = A[minN];
        A[minN] = A[i];
        A[i] = X;
        C++;
      }
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      min = A[i];
      for(int j=i;j<N;j++){
        if(min>A[j]){
          min = A[j];
          minN = j;
        }
      }
      if(min!=A[i]){
        X = A[minN];
        A[minN] = A[i];
        A[i] = X;
        C++;
      }
    } {
      min = A[i];
      for(int j=i;j<N;j++){
        if(min>A[j]){
          min = A[j];
          minN = j;
        }
      }
      if(min!=A[i]){
        X = A[minN];
        A[minN] = A[i];
        A[i] = X;
        C++;
      }
    } min = A[i] min A[i] A i for(int j=i;j<N;j++){
        if(min>A[j]){
          min = A[j];
          minN = j;
        }
      } int j=i; int j=i; j i j<N j N j++ j++ j {
        if(min>A[j]){
          min = A[j];
          minN = j;
        }
      } {
        if(min>A[j]){
          min = A[j];
          minN = j;
        }
      } if(min>A[j]){
          min = A[j];
          minN = j;
        } min>A[j] min A[j] A j {
          min = A[j];
          minN = j;
        } min = A[j] min A[j] A j minN = j minN j if(min!=A[i]){
        X = A[minN];
        A[minN] = A[i];
        A[i] = X;
        C++;
      } min!=A[i] min A[i] A i {
        X = A[minN];
        A[minN] = A[i];
        A[i] = X;
        C++;
      } X = A[minN] X A[minN] A minN A[minN] = A[i] A[minN] A minN A[i] A i A[i] = X A[i] A i X C++ C for(int i=0;i<N;i++){
      System.out.print(A[i]);
      if(i!=N-1){
        System.out.print(" ");
      }
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      System.out.print(A[i]);
      if(i!=N-1){
        System.out.print(" ");
      }
    } {
      System.out.print(A[i]);
      if(i!=N-1){
        System.out.print(" ");
      }
    } System.out.print(A[i]) System.out.print System.out System System.out A[i] A i if(i!=N-1){
        System.out.print(" ");
      } i!=N-1 i N-1 N 1 {
        System.out.print(" ");
      } System.out.print(" ") System.out.print System.out System System.out " " System.out.print("\n") System.out.print System.out System System.out "\n" System.out.println(C) System.out.println System.out System System.out C String[] args args
import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N,X,C=0;
    int min,minN=0;
    int A[] = new int[100];

    N = scanner.nextInt();

    for(int i=0;i<N;i++){
      A[i] = scanner.nextInt();
    }

    for(int i=0;i<N;i++){
      min = A[i];
      for(int j=i;j<N;j++){
        if(min>A[j]){
          min = A[j];
          minN = j;
        }
      }
      if(min!=A[i]){
        X = A[minN];
        A[minN] = A[i];
        A[i] = X;
        C++;
      }
    }

    for(int i=0;i<N;i++){
      System.out.print(A[i]);
      if(i!=N-1){
        System.out.print(" ");
      }
    }
    System.out.print("\n");
    System.out.println(C);

  }
}
