#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, countX = 0, minutes = 0, countx = 0;
  string position;
  cin >> n >> position;
  int positionlen = position.size();
  for (int i = 0; i < positionlen; i++) {
    if (position.at(i) == 'X')
      countX++;
    else
      countx++;
  }
  if (countX < n / 2) {
    int modify = n / 2 - countX;
    for (int i = 0; i < positionlen; i++) {
      if (modify == 0) break;
      if (position.at(i) == 'x') {
        position.at(i) = 'X';
        modify--;
        minutes++;
      }
    }
  } else if (countx < n / 2) {
    int modify = n / 2 - countx;
    for (int i = 0; i < positionlen; i++) {
      if (modify == 0) break;
      if (position.at(i) == 'X') {
        position.at(i) = 'x';
        modify--;
        minutes++;
      }
    }
  }
  cout << minutes << "\n" << position << endl;
  return 0;
}
