#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt = 0, cx = 0, sx = 0, i;
  string str;
  cin >> n >> str;
  for (i = 0; str[i]; i++) {
    if (str[i] == 'x')
      sx++;
    else
      cx++;
  }
  if (sx == cx) {
    cout << 0 << endl << str << endl;
  } else {
    cout << min(abs(n / 2 - sx), abs(n / 2 - cx)) << endl;
    char fnd, dump;
    if (sx > n / 2) {
      sx -= (n / 2);
      fnd = 'x';
      dump = 'X';
    } else {
      sx = (n / 2) - sx;
      fnd = 'X';
      dump = 'x';
    }
    for (i = 0; i < n; i++) {
      if (sx > 0 && fnd == str[i]) {
        cout << dump;
        sx--;
      } else
        cout << str[i];
    }
    cout << endl;
  }
  return 0;
}
