#include <bits/stdc++.h>
using namespace std;
string p;
int main() {
  int n;
  cin >> n;
  cin >> p;
  int num = count(p.begin(), p.end(), 'X') - n / 2;
  if (num == 0)
    cout << 0 << endl << p << endl;
  else {
    int f;
    f = abs(num);
    cout << f << endl;
    int Count = 0;
    for (int i = 0; i < n && Count < f; i++) {
      if (num > 0 && p[i] == 'X') {
        p[i] = 'x';
        Count++;
      }
      if (num < 0 && p[i] == 'x') {
        p[i] = 'X';
        Count++;
      }
    }
    cout << p << endl;
  }
}
