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