import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		ContestScanner scan = new ContestScanner();
		int N = scan.nextInt();
		int[] A = new int[N];

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

		(new Solve(A, N)).solve();
	}
}

class Solve {
	private final int[] A;
	private final int N;

	public Solve(final int[] A, final int N)
	{
		this.A = A;
		this.N = N;
	}

	public void solve()
	{
		int count = 0;

		int[] sorted = new int[N];

		for(int i=0; i < N; i++) sorted[i] = A[i];

		for(int i=0, minj=0; i < N; i++)
		{
			minj = i;

			for(int j=i; j < N; j++)
			{
				if(sorted[j] < sorted[minj])
				{
					minj = j;
				}
			}

			if(i != minj)
			{
				int e = sorted[i];
				sorted[i] = sorted[minj];
				sorted[minj] = e;
				count++;
			}
		}

		for(int i=0; i < N; i++)
		{
			if(i > 0) System.out.print(" ");
			System.out.print(sorted[i]);
		}
		System.out.println("");
		System.out.println(count);
	}
}

class ContestScanner {
	BufferedReader reader;
	String[] line;
	int index;
	public ContestScanner() {
		reader = new BufferedReader(new InputStreamReader(System.in));
	}

	public ContestScanner(String filename) throws FileNotFoundException {
		reader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
	}

	public String nextToken() throws IOException {
		if(line == null || index >= line.length)
		{
			line = reader.readLine().trim().split(" ");
			index = 0;
		}

		return line[index++];
	}

	public String next() throws IOException {
		return nextToken();
	}

	public String readLine() throws IOException {
		line = null;
		index = 0;

		return reader.readLine();
	}

	public int nextInt() throws IOException, NumberFormatException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException, NumberFormatException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException, NumberFormatException {
		return Double.parseDouble(nextToken());
	}

	public int[] nextIntArray(int N) throws IOException, NumberFormatException {
		int[] result = new int[N];

		for(int i=0; i < N; i++) result[i] = nextInt();

		return result;
	}

	public long[] nextLongArray(int N) throws IOException, NumberFormatException {
		long[] result = new long[N];

		for(int i=0; i < N; i++) result[i] = nextLong();

		return result;
	}

	public double[] nexDoubleArray(int N) throws IOException, NumberFormatException {
		double[] result = new double[N];

		for(int i=0; i < N; i++) result[i] = nextDouble();

		return result;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.FileInputStream; FileInputStream java.io import java.io.FileNotFoundException; FileNotFoundException java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws IOException {
		ContestScanner scan = new ContestScanner();
		int N = scan.nextInt();
		int[] A = new int[N];

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

		(new Solve(A, N)).solve();
	}
} Main public static void main(String[] args) throws IOException {
		ContestScanner scan = new ContestScanner();
		int N = scan.nextInt();
		int[] A = new int[N];

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

		(new Solve(A, N)).solve();
	} main {
		ContestScanner scan = new ContestScanner();
		int N = scan.nextInt();
		int[] A = new int[N];

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

		(new Solve(A, N)).solve();
	} ContestScanner scan = new ContestScanner(); scan new ContestScanner() int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int[] A = new int[N]; A new int[N] N for(int i=0; i < N; i++) A[i] = scan.nextInt(); int i=0; int i=0; i 0 i < N i N i++ i++ i A[i] = scan.nextInt(); A[i] = scan.nextInt() A[i] A i scan.nextInt() scan.nextInt scan (new Solve(A, N)).solve() (new Solve(A, N)).solve (new Solve(A, N)) String[] args args class Solve {
	private final int[] A;
	private final int N;

	public Solve(final int[] A, final int N)
	{
		this.A = A;
		this.N = N;
	}

	public void solve()
	{
		int count = 0;

		int[] sorted = new int[N];

		for(int i=0; i < N; i++) sorted[i] = A[i];

		for(int i=0, minj=0; i < N; i++)
		{
			minj = i;

			for(int j=i; j < N; j++)
			{
				if(sorted[j] < sorted[minj])
				{
					minj = j;
				}
			}

			if(i != minj)
			{
				int e = sorted[i];
				sorted[i] = sorted[minj];
				sorted[minj] = e;
				count++;
			}
		}

		for(int i=0; i < N; i++)
		{
			if(i > 0) System.out.print(" ");
			System.out.print(sorted[i]);
		}
		System.out.println("");
		System.out.println(count);
	}
} Solve private final int[] A; A private final int N; N public Solve(final int[] A, final int N)
	{
		this.A = A;
		this.N = N;
	} Solve {
		this.A = A;
		this.N = N;
	} this.A = A this.A this this.A A this.N = N this.N this this.N N final int[] A A final int N N public void solve()
	{
		int count = 0;

		int[] sorted = new int[N];

		for(int i=0; i < N; i++) sorted[i] = A[i];

		for(int i=0, minj=0; i < N; i++)
		{
			minj = i;

			for(int j=i; j < N; j++)
			{
				if(sorted[j] < sorted[minj])
				{
					minj = j;
				}
			}

			if(i != minj)
			{
				int e = sorted[i];
				sorted[i] = sorted[minj];
				sorted[minj] = e;
				count++;
			}
		}

		for(int i=0; i < N; i++)
		{
			if(i > 0) System.out.print(" ");
			System.out.print(sorted[i]);
		}
		System.out.println("");
		System.out.println(count);
	} solve {
		int count = 0;

		int[] sorted = new int[N];

		for(int i=0; i < N; i++) sorted[i] = A[i];

		for(int i=0, minj=0; i < N; i++)
		{
			minj = i;

			for(int j=i; j < N; j++)
			{
				if(sorted[j] < sorted[minj])
				{
					minj = j;
				}
			}

			if(i != minj)
			{
				int e = sorted[i];
				sorted[i] = sorted[minj];
				sorted[minj] = e;
				count++;
			}
		}

		for(int i=0; i < N; i++)
		{
			if(i > 0) System.out.print(" ");
			System.out.print(sorted[i]);
		}
		System.out.println("");
		System.out.println(count);
	} int count = 0; count 0 int[] sorted = new int[N]; sorted new int[N] N for(int i=0; i < N; i++) sorted[i] = A[i]; int i=0; int i=0; i 0 i < N i N i++ i++ i sorted[i] = A[i]; sorted[i] = A[i] sorted[i] sorted i A[i] A i for(int i=0, minj=0; i < N; i++)
		{
			minj = i;

			for(int j=i; j < N; j++)
			{
				if(sorted[j] < sorted[minj])
				{
					minj = j;
				}
			}

			if(i != minj)
			{
				int e = sorted[i];
				sorted[i] = sorted[minj];
				sorted[minj] = e;
				count++;
			}
		} int i=0, minj=0; int i=0 i 0 minj=0; minj 0 i < N i N i++ i++ i {
			minj = i;

			for(int j=i; j < N; j++)
			{
				if(sorted[j] < sorted[minj])
				{
					minj = j;
				}
			}

			if(i != minj)
			{
				int e = sorted[i];
				sorted[i] = sorted[minj];
				sorted[minj] = e;
				count++;
			}
		} {
			minj = i;

			for(int j=i; j < N; j++)
			{
				if(sorted[j] < sorted[minj])
				{
					minj = j;
				}
			}

			if(i != minj)
			{
				int e = sorted[i];
				sorted[i] = sorted[minj];
				sorted[minj] = e;
				count++;
			}
		} minj = i minj i for(int j=i; j < N; j++)
			{
				if(sorted[j] < sorted[minj])
				{
					minj = j;
				}
			} int j=i; int j=i; j i j < N j N j++ j++ j {
				if(sorted[j] < sorted[minj])
				{
					minj = j;
				}
			} {
				if(sorted[j] < sorted[minj])
				{
					minj = j;
				}
			} if(sorted[j] < sorted[minj])
				{
					minj = j;
				} sorted[j] < sorted[minj] sorted[j] sorted j sorted[minj] sorted minj {
					minj = j;
				} minj = j minj j if(i != minj)
			{
				int e = sorted[i];
				sorted[i] = sorted[minj];
				sorted[minj] = e;
				count++;
			} i != minj i minj {
				int e = sorted[i];
				sorted[i] = sorted[minj];
				sorted[minj] = e;
				count++;
			} int e = sorted[i]; e sorted[i] sorted i sorted[i] = sorted[minj] sorted[i] sorted i sorted[minj] sorted minj sorted[minj] = e sorted[minj] sorted minj e count++ count for(int i=0; i < N; i++)
		{
			if(i > 0) System.out.print(" ");
			System.out.print(sorted[i]);
		} int i=0; int i=0; i 0 i < N i N i++ i++ i {
			if(i > 0) System.out.print(" ");
			System.out.print(sorted[i]);
		} {
			if(i > 0) System.out.print(" ");
			System.out.print(sorted[i]);
		} if(i > 0) System.out.print(" "); i > 0 i 0 System.out.print(" ") System.out.print System.out System System.out " " System.out.print(sorted[i]) System.out.print System.out System System.out sorted[i] sorted i System.out.println("") System.out.println System.out System System.out "" System.out.println(count) System.out.println System.out System System.out count class ContestScanner {
	BufferedReader reader;
	String[] line;
	int index;
	public ContestScanner() {
		reader = new BufferedReader(new InputStreamReader(System.in));
	}

	public ContestScanner(String filename) throws FileNotFoundException {
		reader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
	}

	public String nextToken() throws IOException {
		if(line == null || index >= line.length)
		{
			line = reader.readLine().trim().split(" ");
			index = 0;
		}

		return line[index++];
	}

	public String next() throws IOException {
		return nextToken();
	}

	public String readLine() throws IOException {
		line = null;
		index = 0;

		return reader.readLine();
	}

	public int nextInt() throws IOException, NumberFormatException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException, NumberFormatException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException, NumberFormatException {
		return Double.parseDouble(nextToken());
	}

	public int[] nextIntArray(int N) throws IOException, NumberFormatException {
		int[] result = new int[N];

		for(int i=0; i < N; i++) result[i] = nextInt();

		return result;
	}

	public long[] nextLongArray(int N) throws IOException, NumberFormatException {
		long[] result = new long[N];

		for(int i=0; i < N; i++) result[i] = nextLong();

		return result;
	}

	public double[] nexDoubleArray(int N) throws IOException, NumberFormatException {
		double[] result = new double[N];

		for(int i=0; i < N; i++) result[i] = nextDouble();

		return result;
	}
} ContestScanner BufferedReader reader; reader String[] line; line int index; index public ContestScanner() {
		reader = new BufferedReader(new InputStreamReader(System.in));
	} ContestScanner {
		reader = new BufferedReader(new InputStreamReader(System.in));
	} reader = new BufferedReader(new InputStreamReader(System.in)) reader new BufferedReader(new InputStreamReader(System.in)) public ContestScanner(String filename) throws FileNotFoundException {
		reader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
	} ContestScanner {
		reader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
	} reader = new BufferedReader(new InputStreamReader(new FileInputStream(filename))) reader new BufferedReader(new InputStreamReader(new FileInputStream(filename))) String filename filename public String nextToken() throws IOException {
		if(line == null || index >= line.length)
		{
			line = reader.readLine().trim().split(" ");
			index = 0;
		}

		return line[index++];
	} nextToken {
		if(line == null || index >= line.length)
		{
			line = reader.readLine().trim().split(" ");
			index = 0;
		}

		return line[index++];
	} if(line == null || index >= line.length)
		{
			line = reader.readLine().trim().split(" ");
			index = 0;
		} line == null || index >= line.length line == null line null index >= line.length index line.length line line.length {
			line = reader.readLine().trim().split(" ");
			index = 0;
		} line = reader.readLine().trim().split(" ") line reader.readLine().trim().split(" ") reader.readLine().trim().split reader.readLine().trim() reader.readLine().trim reader.readLine() reader.readLine reader " " index = 0 index 0 return line[index++]; line[index++] line index++ index public String next() throws IOException {
		return nextToken();
	} next {
		return nextToken();
	} return nextToken(); nextToken() nextToken public String readLine() throws IOException {
		line = null;
		index = 0;

		return reader.readLine();
	} readLine {
		line = null;
		index = 0;

		return reader.readLine();
	} line = null line null index = 0 index 0 return reader.readLine(); reader.readLine() reader.readLine reader public int nextInt() throws IOException, NumberFormatException {
		return Integer.parseInt(nextToken());
	} nextInt {
		return Integer.parseInt(nextToken());
	} return Integer.parseInt(nextToken()); Integer.parseInt(nextToken()) Integer.parseInt Integer nextToken() nextToken public long nextLong() throws IOException, NumberFormatException {
		return Long.parseLong(nextToken());
	} nextLong {
		return Long.parseLong(nextToken());
	} return Long.parseLong(nextToken()); Long.parseLong(nextToken()) Long.parseLong Long nextToken() nextToken public double nextDouble() throws IOException, NumberFormatException {
		return Double.parseDouble(nextToken());
	} nextDouble {
		return Double.parseDouble(nextToken());
	} return Double.parseDouble(nextToken()); Double.parseDouble(nextToken()) Double.parseDouble Double nextToken() nextToken public int[] nextIntArray(int N) throws IOException, NumberFormatException {
		int[] result = new int[N];

		for(int i=0; i < N; i++) result[i] = nextInt();

		return result;
	} nextIntArray {
		int[] result = new int[N];

		for(int i=0; i < N; i++) result[i] = nextInt();

		return result;
	} int[] result = new int[N]; result new int[N] N for(int i=0; i < N; i++) result[i] = nextInt(); int i=0; int i=0; i 0 i < N i N i++ i++ i result[i] = nextInt(); result[i] = nextInt() result[i] result i nextInt() nextInt return result; result int N N public long[] nextLongArray(int N) throws IOException, NumberFormatException {
		long[] result = new long[N];

		for(int i=0; i < N; i++) result[i] = nextLong();

		return result;
	} nextLongArray {
		long[] result = new long[N];

		for(int i=0; i < N; i++) result[i] = nextLong();

		return result;
	} long[] result = new long[N]; result new long[N] N for(int i=0; i < N; i++) result[i] = nextLong(); int i=0; int i=0; i 0 i < N i N i++ i++ i result[i] = nextLong(); result[i] = nextLong() result[i] result i nextLong() nextLong return result; result int N N public double[] nexDoubleArray(int N) throws IOException, NumberFormatException {
		double[] result = new double[N];

		for(int i=0; i < N; i++) result[i] = nextDouble();

		return result;
	} nexDoubleArray {
		double[] result = new double[N];

		for(int i=0; i < N; i++) result[i] = nextDouble();

		return result;
	} double[] result = new double[N]; result new double[N] N for(int i=0; i < N; i++) result[i] = nextDouble(); int i=0; int i=0; i 0 i < N i N i++ i++ i result[i] = nextDouble(); result[i] = nextDouble() result[i] result i nextDouble() nextDouble return result; result int N N public class Main {
	public static void main(String[] args) throws IOException {
		ContestScanner scan = new ContestScanner();
		int N = scan.nextInt();
		int[] A = new int[N];

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

		(new Solve(A, N)).solve();
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		ContestScanner scan = new ContestScanner();
		int N = scan.nextInt();
		int[] A = new int[N];

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

		(new Solve(A, N)).solve();
	}
} Main
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		ContestScanner scan = new ContestScanner();
		int N = scan.nextInt();
		int[] A = new int[N];

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

		(new Solve(A, N)).solve();
	}
}

class Solve {
	private final int[] A;
	private final int N;

	public Solve(final int[] A, final int N)
	{
		this.A = A;
		this.N = N;
	}

	public void solve()
	{
		int count = 0;

		int[] sorted = new int[N];

		for(int i=0; i < N; i++) sorted[i] = A[i];

		for(int i=0, minj=0; i < N; i++)
		{
			minj = i;

			for(int j=i; j < N; j++)
			{
				if(sorted[j] < sorted[minj])
				{
					minj = j;
				}
			}

			if(i != minj)
			{
				int e = sorted[i];
				sorted[i] = sorted[minj];
				sorted[minj] = e;
				count++;
			}
		}

		for(int i=0; i < N; i++)
		{
			if(i > 0) System.out.print(" ");
			System.out.print(sorted[i]);
		}
		System.out.println("");
		System.out.println(count);
	}
}

class ContestScanner {
	BufferedReader reader;
	String[] line;
	int index;
	public ContestScanner() {
		reader = new BufferedReader(new InputStreamReader(System.in));
	}

	public ContestScanner(String filename) throws FileNotFoundException {
		reader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
	}

	public String nextToken() throws IOException {
		if(line == null || index >= line.length)
		{
			line = reader.readLine().trim().split(" ");
			index = 0;
		}

		return line[index++];
	}

	public String next() throws IOException {
		return nextToken();
	}

	public String readLine() throws IOException {
		line = null;
		index = 0;

		return reader.readLine();
	}

	public int nextInt() throws IOException, NumberFormatException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException, NumberFormatException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException, NumberFormatException {
		return Double.parseDouble(nextToken());
	}

	public int[] nextIntArray(int N) throws IOException, NumberFormatException {
		int[] result = new int[N];

		for(int i=0; i < N; i++) result[i] = nextInt();

		return result;
	}

	public long[] nextLongArray(int N) throws IOException, NumberFormatException {
		long[] result = new long[N];

		for(int i=0; i < N; i++) result[i] = nextLong();

		return result;
	}

	public double[] nexDoubleArray(int N) throws IOException, NumberFormatException {
		double[] result = new double[N];

		for(int i=0; i < N; i++) result[i] = nextDouble();

		return result;
	}
}