def selectionSort(A, N):
    for i in range(N - 1):
        minValue = 100
        minIndex = 0
        for j in range(i, N):
            if A[j] < minValue:
                minValue = A[j]
                minIndex = j
        temp = A[i]
        A[i] = minValue
        A[minIndex] = temp

    for i in range(N):
        print A[i],
    print
    print N - 1

N = input()
A = map(int, raw_input().split())

selectionSort(A, N)