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