import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N[] = new int[100];
    int n = sc.nextInt();
    int m = 0;
    for (int i = 0; i < n; i++) N[i] = sc.nextInt();
    for (int i = 0; i < n-1; i++) {
        int min = i;
        for (int j = i+1; j < n; j++) {
            if (N[j] < N[min]) {
                min = j;
            }
        }
        if (min != i) m++;
        int temp = N[i];
        N[i] = N[min];
        N[min] = temp;
    }
    for (int i = 0; i < n; i++) {
      if (i == 0) System.out.printf("%d", N[i]);
      else System.out.printf(" %d", N[i]);
    }
    System.out.printf("\n");
    System.out.println(m);
  }
}
 import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N[] = new int[100];
    int n = sc.nextInt();
    int m = 0;
    for (int i = 0; i < n; i++) N[i] = sc.nextInt();
    for (int i = 0; i < n-1; i++) {
        int min = i;
        for (int j = i+1; j < n; j++) {
            if (N[j] < N[min]) {
                min = j;
            }
        }
        if (min != i) m++;
        int temp = N[i];
        N[i] = N[min];
        N[min] = temp;
    }
    for (int i = 0; i < n; i++) {
      if (i == 0) System.out.printf("%d", N[i]);
      else System.out.printf(" %d", N[i]);
    }
    System.out.printf("\n");
    System.out.println(m);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N[] = new int[100];
    int n = sc.nextInt();
    int m = 0;
    for (int i = 0; i < n; i++) N[i] = sc.nextInt();
    for (int i = 0; i < n-1; i++) {
        int min = i;
        for (int j = i+1; j < n; j++) {
            if (N[j] < N[min]) {
                min = j;
            }
        }
        if (min != i) m++;
        int temp = N[i];
        N[i] = N[min];
        N[min] = temp;
    }
    for (int i = 0; i < n; i++) {
      if (i == 0) System.out.printf("%d", N[i]);
      else System.out.printf(" %d", N[i]);
    }
    System.out.printf("\n");
    System.out.println(m);
  } main {
    Scanner sc = new Scanner(System.in);
    int N[] = new int[100];
    int n = sc.nextInt();
    int m = 0;
    for (int i = 0; i < n; i++) N[i] = sc.nextInt();
    for (int i = 0; i < n-1; i++) {
        int min = i;
        for (int j = i+1; j < n; j++) {
            if (N[j] < N[min]) {
                min = j;
            }
        }
        if (min != i) m++;
        int temp = N[i];
        N[i] = N[min];
        N[min] = temp;
    }
    for (int i = 0; i < n; i++) {
      if (i == 0) System.out.printf("%d", N[i]);
      else System.out.printf(" %d", N[i]);
    }
    System.out.printf("\n");
    System.out.println(m);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N[] = new int[100]; N new int[100] 100 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = 0; m 0 for (int i = 0; i < n; i++) N[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i N[i] = sc.nextInt(); N[i] = sc.nextInt() N[i] N i sc.nextInt() sc.nextInt sc for (int i = 0; i < n-1; i++) {
        int min = i;
        for (int j = i+1; j < n; j++) {
            if (N[j] < N[min]) {
                min = j;
            }
        }
        if (min != i) m++;
        int temp = N[i];
        N[i] = N[min];
        N[min] = temp;
    } int i = 0; int i = 0; i 0 i < n-1 i n-1 n 1 i++ i++ i {
        int min = i;
        for (int j = i+1; j < n; j++) {
            if (N[j] < N[min]) {
                min = j;
            }
        }
        if (min != i) m++;
        int temp = N[i];
        N[i] = N[min];
        N[min] = temp;
    } {
        int min = i;
        for (int j = i+1; j < n; j++) {
            if (N[j] < N[min]) {
                min = j;
            }
        }
        if (min != i) m++;
        int temp = N[i];
        N[i] = N[min];
        N[min] = temp;
    } int min = i; min i for (int j = i+1; j < n; j++) {
            if (N[j] < N[min]) {
                min = j;
            }
        } int j = i+1; int j = i+1; j i+1 i 1 j < n j n j++ j++ j {
            if (N[j] < N[min]) {
                min = j;
            }
        } {
            if (N[j] < N[min]) {
                min = j;
            }
        } if (N[j] < N[min]) {
                min = j;
            } N[j] < N[min] N[j] N j N[min] N min {
                min = j;
            } min = j min j if (min != i) m++; min != i min i m++ m int temp = N[i]; temp N[i] N i N[i] = N[min] N[i] N i N[min] N min N[min] = temp N[min] N min temp for (int i = 0; i < n; i++) {
      if (i == 0) System.out.printf("%d", N[i]);
      else System.out.printf(" %d", N[i]);
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      if (i == 0) System.out.printf("%d", N[i]);
      else System.out.printf(" %d", N[i]);
    } {
      if (i == 0) System.out.printf("%d", N[i]);
      else System.out.printf(" %d", N[i]);
    } if (i == 0) System.out.printf("%d", N[i]);
      else System.out.printf(" %d", N[i]); i == 0 i 0 System.out.printf("%d", N[i]) System.out.printf System.out System System.out "%d" N[i] N i System.out.printf(" %d", N[i]) System.out.printf System.out System System.out " %d" N[i] N i System.out.printf("\n") System.out.printf System.out System System.out "\n" System.out.println(m) System.out.println System.out System System.out m String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N[] = new int[100];
    int n = sc.nextInt();
    int m = 0;
    for (int i = 0; i < n; i++) N[i] = sc.nextInt();
    for (int i = 0; i < n-1; i++) {
        int min = i;
        for (int j = i+1; j < n; j++) {
            if (N[j] < N[min]) {
                min = j;
            }
        }
        if (min != i) m++;
        int temp = N[i];
        N[i] = N[min];
        N[min] = temp;
    }
    for (int i = 0; i < n; i++) {
      if (i == 0) System.out.printf("%d", N[i]);
      else System.out.printf(" %d", N[i]);
    }
    System.out.printf("\n");
    System.out.println(m);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N[] = new int[100];
    int n = sc.nextInt();
    int m = 0;
    for (int i = 0; i < n; i++) N[i] = sc.nextInt();
    for (int i = 0; i < n-1; i++) {
        int min = i;
        for (int j = i+1; j < n; j++) {
            if (N[j] < N[min]) {
                min = j;
            }
        }
        if (min != i) m++;
        int temp = N[i];
        N[i] = N[min];
        N[min] = temp;
    }
    for (int i = 0; i < n; i++) {
      if (i == 0) System.out.printf("%d", N[i]);
      else System.out.printf(" %d", N[i]);
    }
    System.out.printf("\n");
    System.out.println(m);
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N[] = new int[100];
    int n = sc.nextInt();
    int m = 0;
    for (int i = 0; i < n; i++) N[i] = sc.nextInt();
    for (int i = 0; i < n-1; i++) {
        int min = i;
        for (int j = i+1; j < n; j++) {
            if (N[j] < N[min]) {
                min = j;
            }
        }
        if (min != i) m++;
        int temp = N[i];
        N[i] = N[min];
        N[min] = temp;
    }
    for (int i = 0; i < n; i++) {
      if (i == 0) System.out.printf("%d", N[i]);
      else System.out.printf(" %d", N[i]);
    }
    System.out.printf("\n");
    System.out.println(m);
  }
}

