#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string str;
  cin >> str;
  int x_cnt = count(begin(str), end(str), 'x');
  int y_cnt = str.size() - x_cnt;
  int d = 0;
  char in, out;
  if (x_cnt <= y_cnt) {
    d = (y_cnt - x_cnt) / 2;
    in = 'X', out = 'x';
  } else {
    d = (x_cnt - y_cnt) / 2;
    in = 'x', out = 'X';
  }
  for (int i = 0; i < str.size() && d; ++i) {
    if (str[i] == in) {
      str[i] = out;
      --d;
    }
  }
  cout << abs(x_cnt - y_cnt) / 2 << endl << str;
  return 0;
}
