import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt(),x,y,count = 0;
    int[] n = new int[N];
    
    for(int i = 0; i < N; i++)
    	n[i] = sc.nextInt();
    
    for(int i = 0; i < N; i++){
    	x = i;
    	for(int j = i; j < N; j++){
    		if(n[j] < n[x])
    			x = j;
    	}
    		
    	if(i != x){
    		y = n[i];
    		n[i] = n[x];
    		n[x] = y;
    		count++;
    	}	
    }
    for(int i = 0; i < N; i++)
    	if(i != N - 1)
    		System.out.print(n[i] + " ");
    	else
    		System.out.println(n[i]);
    
    System.out.println(count);
    
    sc.close();
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt(),x,y,count = 0;
    int[] n = new int[N];
    
    for(int i = 0; i < N; i++)
    	n[i] = sc.nextInt();
    
    for(int i = 0; i < N; i++){
    	x = i;
    	for(int j = i; j < N; j++){
    		if(n[j] < n[x])
    			x = j;
    	}
    		
    	if(i != x){
    		y = n[i];
    		n[i] = n[x];
    		n[x] = y;
    		count++;
    	}	
    }
    for(int i = 0; i < N; i++)
    	if(i != N - 1)
    		System.out.print(n[i] + " ");
    	else
    		System.out.println(n[i]);
    
    System.out.println(count);
    
    sc.close();
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt(),x,y,count = 0;
    int[] n = new int[N];
    
    for(int i = 0; i < N; i++)
    	n[i] = sc.nextInt();
    
    for(int i = 0; i < N; i++){
    	x = i;
    	for(int j = i; j < N; j++){
    		if(n[j] < n[x])
    			x = j;
    	}
    		
    	if(i != x){
    		y = n[i];
    		n[i] = n[x];
    		n[x] = y;
    		count++;
    	}	
    }
    for(int i = 0; i < N; i++)
    	if(i != N - 1)
    		System.out.print(n[i] + " ");
    	else
    		System.out.println(n[i]);
    
    System.out.println(count);
    
    sc.close();
  } main {
    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt(),x,y,count = 0;
    int[] n = new int[N];
    
    for(int i = 0; i < N; i++)
    	n[i] = sc.nextInt();
    
    for(int i = 0; i < N; i++){
    	x = i;
    	for(int j = i; j < N; j++){
    		if(n[j] < n[x])
    			x = j;
    	}
    		
    	if(i != x){
    		y = n[i];
    		n[i] = n[x];
    		n[x] = y;
    		count++;
    	}	
    }
    for(int i = 0; i < N; i++)
    	if(i != N - 1)
    		System.out.print(n[i] + " ");
    	else
    		System.out.println(n[i]);
    
    System.out.println(count);
    
    sc.close();
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt() N sc.nextInt() sc.nextInt sc x x y y count = 0; count 0 int[] n = new int[N]; n new int[N] N 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; i++){
    	x = i;
    	for(int j = i; j < N; j++){
    		if(n[j] < n[x])
    			x = j;
    	}
    		
    	if(i != x){
    		y = n[i];
    		n[i] = n[x];
    		n[x] = y;
    		count++;
    	}	
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
    	x = i;
    	for(int j = i; j < N; j++){
    		if(n[j] < n[x])
    			x = j;
    	}
    		
    	if(i != x){
    		y = n[i];
    		n[i] = n[x];
    		n[x] = y;
    		count++;
    	}	
    } {
    	x = i;
    	for(int j = i; j < N; j++){
    		if(n[j] < n[x])
    			x = j;
    	}
    		
    	if(i != x){
    		y = n[i];
    		n[i] = n[x];
    		n[x] = y;
    		count++;
    	}	
    } x = i x i for(int j = i; j < N; j++){
    		if(n[j] < n[x])
    			x = j;
    	} int j = i; int j = i; j i j < N j N j++ j++ j {
    		if(n[j] < n[x])
    			x = j;
    	} {
    		if(n[j] < n[x])
    			x = j;
    	} if(n[j] < n[x])
    			x = j; n[j] < n[x] n[j] n j n[x] n x x = j x j if(i != x){
    		y = n[i];
    		n[i] = n[x];
    		n[x] = y;
    		count++;
    	} i != x i x {
    		y = n[i];
    		n[i] = n[x];
    		n[x] = y;
    		count++;
    	} y = n[i] y n[i] n i n[i] = n[x] n[i] n i n[x] n x n[x] = y n[x] n x y count++ count for(int i = 0; i < N; i++)
    	if(i != N - 1)
    		System.out.print(n[i] + " ");
    	else
    		System.out.println(n[i]); int i = 0; int i = 0; i 0 i < N i N i++ i++ i if(i != N - 1)
    		System.out.print(n[i] + " ");
    	else
    		System.out.println(n[i]); if(i != N - 1)
    		System.out.print(n[i] + " ");
    	else
    		System.out.println(n[i]); i != N - 1 i N - 1 N 1 System.out.print(n[i] + " ") System.out.print System.out System System.out n[i] + " " n[i] n i " " System.out.println(n[i]) System.out.println System.out System System.out n[i] n i System.out.println(count) System.out.println System.out System System.out count sc.close() sc.close sc String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt(),x,y,count = 0;
    int[] n = new int[N];
    
    for(int i = 0; i < N; i++)
    	n[i] = sc.nextInt();
    
    for(int i = 0; i < N; i++){
    	x = i;
    	for(int j = i; j < N; j++){
    		if(n[j] < n[x])
    			x = j;
    	}
    		
    	if(i != x){
    		y = n[i];
    		n[i] = n[x];
    		n[x] = y;
    		count++;
    	}	
    }
    for(int i = 0; i < N; i++)
    	if(i != N - 1)
    		System.out.print(n[i] + " ");
    	else
    		System.out.println(n[i]);
    
    System.out.println(count);
    
    sc.close();
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt(),x,y,count = 0;
    int[] n = new int[N];
    
    for(int i = 0; i < N; i++)
    	n[i] = sc.nextInt();
    
    for(int i = 0; i < N; i++){
    	x = i;
    	for(int j = i; j < N; j++){
    		if(n[j] < n[x])
    			x = j;
    	}
    		
    	if(i != x){
    		y = n[i];
    		n[i] = n[x];
    		n[x] = y;
    		count++;
    	}	
    }
    for(int i = 0; i < N; i++)
    	if(i != N - 1)
    		System.out.print(n[i] + " ");
    	else
    		System.out.println(n[i]);
    
    System.out.println(count);
    
    sc.close();
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt(),x,y,count = 0;
    int[] n = new int[N];
    
    for(int i = 0; i < N; i++)
    	n[i] = sc.nextInt();
    
    for(int i = 0; i < N; i++){
    	x = i;
    	for(int j = i; j < N; j++){
    		if(n[j] < n[x])
    			x = j;
    	}
    		
    	if(i != x){
    		y = n[i];
    		n[i] = n[x];
    		n[x] = y;
    		count++;
    	}	
    }
    for(int i = 0; i < N; i++)
    	if(i != N - 1)
    		System.out.print(n[i] + " ");
    	else
    		System.out.println(n[i]);
    
    System.out.println(count);
    
    sc.close();
  }
}