N = input()
A = map(int, raw_input().split())
ans = 0
for i in xrange(N-1):
    minj = i
    for j in xrange(i, N-1):
        if A[j] < A[minj]:
            minj = j
    if i != minj:
        ans += 1
        A[i], A[minj] = A[minj], A[i]
print ' '.join(map(str, A))
print ans+1