#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1.0);
int n;
string second;
int main() {
  cin >> n >> second;
  int stand = 0, sit = 0;
  for (int i = 0; i < n; ++i) {
    if (second[i] == 'X')
      stand++;
    else
      sit++;
  }
  if (stand > sit) {
    int k = stand - n / 2;
    for (int i = 0; i < n && k > 0; ++i) {
      if (second[i] == 'X') {
        second[i] = 'x';
        k--;
      }
    }
    cout << stand - n / 2 << endl << second;
  } else if (sit > stand) {
    int k = sit - n / 2;
    for (int i = 0; i < n && k; ++i)
      if (second[i] == 'x') {
        second[i] = 'X';
        k--;
      }
    cout << sit - n / 2 << endl << second;
  } else {
    cout << 0 << endl << second;
  }
  return 0;
}
