#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  cin >> n;
  string s;
  cin >> s;
  int stand = 0, sit = 0;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == 'x')
      sit++;
    else
      stand++;
  }
  int st, si;
  if (stand < (n / 2))
    st = (n / 2) - stand;
  else
    st = 0;
  if (sit < (n / 2))
    si = (n / 2) - sit;
  else
    si = 0;
  int ans = st + si;
  for (i = 0; i < s.size(); i++) {
    if (st == 0)
      break;
    else {
      if (s[i] == 'x') {
        s[i] = 'X';
        st--;
      }
    }
  }
  for (i = 0; i < s.size(); i++) {
    if (si == 0)
      break;
    else {
      if (s[i] == 'X') {
        s[i] = 'x';
        si--;
      }
    }
  }
  cout << ans << endl << s << endl;
}
