#include <bits/stdc++.h>
using namespace std;
const int infinity = 100000000000;
int main() {
  int N;
  while (cin >> N) {
    int i, len, a = 0, b;
    string ss;
    cin >> ss;
    len = N / 2;
    for (i = 0; i < ss.size(); i++)
      if (ss[i] == 'X') a++;
    if (a == len) {
      cout << "0" << endl;
      cout << ss << endl;
      continue;
    }
    b = len - a;
    if (b < 0) {
      b *= -1;
      cout << b << endl;
      for (i = 0; i < ss.size(); i++) {
        if (ss[i] == 'X') {
          ss[i] = 'x';
          b--;
        }
        if (b == 0) break;
      }
      cout << ss << endl;
    } else {
      cout << b << endl;
      for (i = 0; i < ss.size(); i++) {
        if (ss[i] == 'x') {
          ss[i] = 'X';
          b--;
        }
        if (b == 0) break;
      }
      cout << ss << endl;
    }
  }
  return (0);
}
