#include <bits/stdc++.h>
using namespace std;
int main() {
  int sitting = 0;
  int noOfHamsters;
  cin >> noOfHamsters;
  cin.ignore();
  int standing = noOfHamsters;
  string hamsterStatus;
  getline(cin, hamsterStatus);
  for (int i = 0; i < hamsterStatus.length(); i++) {
    if (hamsterStatus[i] == 'x') {
      sitting++;
      standing--;
    }
  }
  if (standing > sitting) {
    cout << (standing - sitting) / 2 << endl;
    for (int j = 0; j < hamsterStatus.length(); j++) {
      if (standing - sitting != 0) {
        if (hamsterStatus[j] == 'X') {
          hamsterStatus[j] = 'x';
          sitting++;
          standing--;
        }
      }
      if (sitting - standing == 0) {
        break;
      }
    }
  } else {
    cout << (sitting - standing) / 2 << endl;
    for (int k = 0; k < hamsterStatus.length(); k++) {
      if (standing - sitting != 0) {
        if (hamsterStatus[k] == 'x') {
          hamsterStatus[k] = 'X';
          sitting--;
          standing++;
        }
      }
      if (sitting - standing == 0) {
        break;
      }
    }
  }
  cout << hamsterStatus << endl;
}
