#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, xC = 0, XC = 0, i, f = 0;
  char c;
  char remain;
  cin >> n;
  string o = "";
  for (i = 0; i < n; i++) {
    cin >> c;
    if (c == 'x') {
      xC++;
      o = o + 'x';
      if (xC == n / 2) {
        remain = 'X';
        i++;
        break;
      }
    } else {
      XC++;
      o = o + 'X';
      if (XC == n / 2) {
        remain = 'x';
        i++;
        break;
      }
    }
  }
  while (i < n) {
    cin >> c;
    if (c != remain) {
      f++;
    }
    o = o + remain;
    i++;
  }
  cout << f << endl;
  cout << o;
  return 0;
}
