#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
#define CLR(a) memset((a), 0, sizeof(a))
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

//using LL = long long;
using namespace std;

const int dy[] = {0, 0, 1, -1};
const int dx[] = {1, -1, 0, 0};
const double EPS = 1e-10;
const double PI = acos(-1.0);

void print(vector<int> v)
{
    int n = v.size();
    for (int i = 0; i < n; i++)
    {
        if (i)
            cout << ' ';
        cout << v[i];
    }
    cout << endl;
}

int selection_Sort(int a[], int n)
{
    int sw = 0;
    int min_j = 0;
    int = 0;
    for(int i=0; i<n-1; i++){
        min_j = i;
        for(int j=0; j<n; j++){
            if (a[j] < a[min_j])
                min_j = j;
        }

        t = a[i];
        a[i] = a[min_j];
        a[min_j] = t;

        if (i != min_j) sw++;
            
    }

    return sw;
}

signed main()
{
    //cin.tie(0);
    //ios::sync_with_stdio(false);

    int n;
    cin >> n;

    //vector<int> v;
    int a[100];
    REP(i, n)
    {
        // int num;
        // cin >> num;
        // v.PB(num);

        cin >> a[i];
    }

    int sw = selection_Sort(v, n);

    REP(i,n){
        if(i>0) cout << " ";
        cout << a[i];
    }

    cout << "\n" << sw << endl;
}
