import java.io.*;
import java.util.ArrayList;
public class Main{
	public static void main(String args[]){
    int a=0,b=0,c=0,i=0,j=0,k=0,minj=0;
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    ArrayList<Integer> SortArray = new ArrayList<Integer>();
    try{
      String line = reader.readLine();
      b = Integer.parseInt(line);
      line = reader.readLine();
      for(String splitted: line.split(" ")){
        SortArray.add(Integer.parseInt(splitted));
      }
		}catch(Exception e){
    }

    int sortArray[] = new int[b];
    for(k = 0;k < b; k++){
      sortArray[k] = SortArray.get(k);
    }

    for (i = 0; i < b - 1; i++) {
      minj = i;
      for (j = i + 1; j < b; j++) {
          if (sortArray[j] < sortArray[minj]) {
            minj = j;
            
          }
          
       }
       if (i == minj) {
        continue;
       }
       c++;
       a = sortArray[i];
       sortArray[i] = sortArray[minj];
       sortArray[minj] = a;
  }

  for(i = 0;i < b;i++){
    System.out.print(sortArray[i]);
    if(i == b - 1){

    }else{
      System.out.print(" ");
    }
  }

  System.out.print("\r\n");
  System.out.println(c);

  }
} import java.io.*; io.* java import java.util.ArrayList; ArrayList java.util public class Main{
	public static void main(String args[]){
    int a=0,b=0,c=0,i=0,j=0,k=0,minj=0;
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    ArrayList<Integer> SortArray = new ArrayList<Integer>();
    try{
      String line = reader.readLine();
      b = Integer.parseInt(line);
      line = reader.readLine();
      for(String splitted: line.split(" ")){
        SortArray.add(Integer.parseInt(splitted));
      }
		}catch(Exception e){
    }

    int sortArray[] = new int[b];
    for(k = 0;k < b; k++){
      sortArray[k] = SortArray.get(k);
    }

    for (i = 0; i < b - 1; i++) {
      minj = i;
      for (j = i + 1; j < b; j++) {
          if (sortArray[j] < sortArray[minj]) {
            minj = j;
            
          }
          
       }
       if (i == minj) {
        continue;
       }
       c++;
       a = sortArray[i];
       sortArray[i] = sortArray[minj];
       sortArray[minj] = a;
  }

  for(i = 0;i < b;i++){
    System.out.print(sortArray[i]);
    if(i == b - 1){

    }else{
      System.out.print(" ");
    }
  }

  System.out.print("\r\n");
  System.out.println(c);

  }
} Main public static void main(String args[]){
    int a=0,b=0,c=0,i=0,j=0,k=0,minj=0;
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    ArrayList<Integer> SortArray = new ArrayList<Integer>();
    try{
      String line = reader.readLine();
      b = Integer.parseInt(line);
      line = reader.readLine();
      for(String splitted: line.split(" ")){
        SortArray.add(Integer.parseInt(splitted));
      }
		}catch(Exception e){
    }

    int sortArray[] = new int[b];
    for(k = 0;k < b; k++){
      sortArray[k] = SortArray.get(k);
    }

    for (i = 0; i < b - 1; i++) {
      minj = i;
      for (j = i + 1; j < b; j++) {
          if (sortArray[j] < sortArray[minj]) {
            minj = j;
            
          }
          
       }
       if (i == minj) {
        continue;
       }
       c++;
       a = sortArray[i];
       sortArray[i] = sortArray[minj];
       sortArray[minj] = a;
  }

  for(i = 0;i < b;i++){
    System.out.print(sortArray[i]);
    if(i == b - 1){

    }else{
      System.out.print(" ");
    }
  }

  System.out.print("\r\n");
  System.out.println(c);

  } main {
    int a=0,b=0,c=0,i=0,j=0,k=0,minj=0;
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    ArrayList<Integer> SortArray = new ArrayList<Integer>();
    try{
      String line = reader.readLine();
      b = Integer.parseInt(line);
      line = reader.readLine();
      for(String splitted: line.split(" ")){
        SortArray.add(Integer.parseInt(splitted));
      }
		}catch(Exception e){
    }

    int sortArray[] = new int[b];
    for(k = 0;k < b; k++){
      sortArray[k] = SortArray.get(k);
    }

    for (i = 0; i < b - 1; i++) {
      minj = i;
      for (j = i + 1; j < b; j++) {
          if (sortArray[j] < sortArray[minj]) {
            minj = j;
            
          }
          
       }
       if (i == minj) {
        continue;
       }
       c++;
       a = sortArray[i];
       sortArray[i] = sortArray[minj];
       sortArray[minj] = a;
  }

  for(i = 0;i < b;i++){
    System.out.print(sortArray[i]);
    if(i == b - 1){

    }else{
      System.out.print(" ");
    }
  }

  System.out.print("\r\n");
  System.out.println(c);

  } int a=0 a 0 b=0 b 0 c=0 c 0 i=0 i 0 j=0 j 0 k=0 k 0 minj=0; minj 0 BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) ArrayList<Integer> SortArray = new ArrayList<Integer>(); SortArray new ArrayList<Integer>() try{
      String line = reader.readLine();
      b = Integer.parseInt(line);
      line = reader.readLine();
      for(String splitted: line.split(" ")){
        SortArray.add(Integer.parseInt(splitted));
      }
		}catch(Exception e){
    } catch(Exception e){
    } Exception e {
    } {
      String line = reader.readLine();
      b = Integer.parseInt(line);
      line = reader.readLine();
      for(String splitted: line.split(" ")){
        SortArray.add(Integer.parseInt(splitted));
      }
		} String line = reader.readLine(); line reader.readLine() reader.readLine reader b = Integer.parseInt(line) b Integer.parseInt(line) Integer.parseInt Integer line line = reader.readLine() line reader.readLine() reader.readLine reader for(String splitted: line.split(" ")){
        SortArray.add(Integer.parseInt(splitted));
      } String splitted line.split(" ") line.split line " " {
        SortArray.add(Integer.parseInt(splitted));
      } {
        SortArray.add(Integer.parseInt(splitted));
      } SortArray.add(Integer.parseInt(splitted)) SortArray.add SortArray Integer.parseInt(splitted) Integer.parseInt Integer splitted int sortArray[] = new int[b]; sortArray new int[b] b for(k = 0;k < b; k++){
      sortArray[k] = SortArray.get(k);
    } k = 0; k = 0 k 0 k < b k b k++ k++ k {
      sortArray[k] = SortArray.get(k);
    } {
      sortArray[k] = SortArray.get(k);
    } sortArray[k] = SortArray.get(k) sortArray[k] sortArray k SortArray.get(k) SortArray.get SortArray k for (i = 0; i < b - 1; i++) {
      minj = i;
      for (j = i + 1; j < b; j++) {
          if (sortArray[j] < sortArray[minj]) {
            minj = j;
            
          }
          
       }
       if (i == minj) {
        continue;
       }
       c++;
       a = sortArray[i];
       sortArray[i] = sortArray[minj];
       sortArray[minj] = a;
  } i = 0; i = 0 i 0 i < b - 1 i b - 1 b 1 i++ i++ i {
      minj = i;
      for (j = i + 1; j < b; j++) {
          if (sortArray[j] < sortArray[minj]) {
            minj = j;
            
          }
          
       }
       if (i == minj) {
        continue;
       }
       c++;
       a = sortArray[i];
       sortArray[i] = sortArray[minj];
       sortArray[minj] = a;
  } {
      minj = i;
      for (j = i + 1; j < b; j++) {
          if (sortArray[j] < sortArray[minj]) {
            minj = j;
            
          }
          
       }
       if (i == minj) {
        continue;
       }
       c++;
       a = sortArray[i];
       sortArray[i] = sortArray[minj];
       sortArray[minj] = a;
  } minj = i minj i for (j = i + 1; j < b; j++) {
          if (sortArray[j] < sortArray[minj]) {
            minj = j;
            
          }
          
       } j = i + 1; j = i + 1 j i + 1 i 1 j < b j b j++ j++ j {
          if (sortArray[j] < sortArray[minj]) {
            minj = j;
            
          }
          
       } {
          if (sortArray[j] < sortArray[minj]) {
            minj = j;
            
          }
          
       } if (sortArray[j] < sortArray[minj]) {
            minj = j;
            
          } sortArray[j] < sortArray[minj] sortArray[j] sortArray j sortArray[minj] sortArray minj {
            minj = j;
            
          } minj = j minj j if (i == minj) {
        continue;
       } i == minj i minj {
        continue;
       } continue; c++ c a = sortArray[i] a sortArray[i] sortArray i sortArray[i] = sortArray[minj] sortArray[i] sortArray i sortArray[minj] sortArray minj sortArray[minj] = a sortArray[minj] sortArray minj a for(i = 0;i < b;i++){
    System.out.print(sortArray[i]);
    if(i == b - 1){

    }else{
      System.out.print(" ");
    }
  } i = 0; i = 0 i 0 i < b i b i++ i++ i {
    System.out.print(sortArray[i]);
    if(i == b - 1){

    }else{
      System.out.print(" ");
    }
  } {
    System.out.print(sortArray[i]);
    if(i == b - 1){

    }else{
      System.out.print(" ");
    }
  } System.out.print(sortArray[i]) System.out.print System.out System System.out sortArray[i] sortArray i if(i == b - 1){

    }else{
      System.out.print(" ");
    } i == b - 1 i b - 1 b 1 {

    } {
      System.out.print(" ");
    } System.out.print(" ") System.out.print System.out System System.out " " System.out.print("\r\n") System.out.print System.out System System.out "\r\n" System.out.println(c) System.out.println System.out System System.out c String args[] args public class Main{
	public static void main(String args[]){
    int a=0,b=0,c=0,i=0,j=0,k=0,minj=0;
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    ArrayList<Integer> SortArray = new ArrayList<Integer>();
    try{
      String line = reader.readLine();
      b = Integer.parseInt(line);
      line = reader.readLine();
      for(String splitted: line.split(" ")){
        SortArray.add(Integer.parseInt(splitted));
      }
		}catch(Exception e){
    }

    int sortArray[] = new int[b];
    for(k = 0;k < b; k++){
      sortArray[k] = SortArray.get(k);
    }

    for (i = 0; i < b - 1; i++) {
      minj = i;
      for (j = i + 1; j < b; j++) {
          if (sortArray[j] < sortArray[minj]) {
            minj = j;
            
          }
          
       }
       if (i == minj) {
        continue;
       }
       c++;
       a = sortArray[i];
       sortArray[i] = sortArray[minj];
       sortArray[minj] = a;
  }

  for(i = 0;i < b;i++){
    System.out.print(sortArray[i]);
    if(i == b - 1){

    }else{
      System.out.print(" ");
    }
  }

  System.out.print("\r\n");
  System.out.println(c);

  }
} public class Main{
	public static void main(String args[]){
    int a=0,b=0,c=0,i=0,j=0,k=0,minj=0;
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    ArrayList<Integer> SortArray = new ArrayList<Integer>();
    try{
      String line = reader.readLine();
      b = Integer.parseInt(line);
      line = reader.readLine();
      for(String splitted: line.split(" ")){
        SortArray.add(Integer.parseInt(splitted));
      }
		}catch(Exception e){
    }

    int sortArray[] = new int[b];
    for(k = 0;k < b; k++){
      sortArray[k] = SortArray.get(k);
    }

    for (i = 0; i < b - 1; i++) {
      minj = i;
      for (j = i + 1; j < b; j++) {
          if (sortArray[j] < sortArray[minj]) {
            minj = j;
            
          }
          
       }
       if (i == minj) {
        continue;
       }
       c++;
       a = sortArray[i];
       sortArray[i] = sortArray[minj];
       sortArray[minj] = a;
  }

  for(i = 0;i < b;i++){
    System.out.print(sortArray[i]);
    if(i == b - 1){

    }else{
      System.out.print(" ");
    }
  }

  System.out.print("\r\n");
  System.out.println(c);

  }
} Main
import java.io.*;
import java.util.ArrayList;
public class Main{
	public static void main(String args[]){
    int a=0,b=0,c=0,i=0,j=0,k=0,minj=0;
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    ArrayList<Integer> SortArray = new ArrayList<Integer>();
    try{
      String line = reader.readLine();
      b = Integer.parseInt(line);
      line = reader.readLine();
      for(String splitted: line.split(" ")){
        SortArray.add(Integer.parseInt(splitted));
      }
		}catch(Exception e){
    }

    int sortArray[] = new int[b];
    for(k = 0;k < b; k++){
      sortArray[k] = SortArray.get(k);
    }

    for (i = 0; i < b - 1; i++) {
      minj = i;
      for (j = i + 1; j < b; j++) {
          if (sortArray[j] < sortArray[minj]) {
            minj = j;
            
          }
          
       }
       if (i == minj) {
        continue;
       }
       c++;
       a = sortArray[i];
       sortArray[i] = sortArray[minj];
       sortArray[minj] = a;
  }

  for(i = 0;i < b;i++){
    System.out.print(sortArray[i]);
    if(i == b - 1){

    }else{
      System.out.print(" ");
    }
  }

  System.out.print("\r\n");
  System.out.println(c);

  }
}
