#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int u = 0, d = 0;
  for (int i = 0; i < (int)s.size(); i++) {
    if (s[i] == 'X') {
      u++;
    } else {
      d++;
    }
  }
  if (u > d) {
    int c = n / 2 - d;
    cout << c << endl;
    for (int i = 0; i < (int)s.size(); i++) {
      if (s[i] == 'X' && c) {
        s[i] = 'x';
        c--;
      }
    }
  } else if (u < d) {
    int c = n / 2 - u;
    cout << c << endl;
    for (int i = 0; i < (int)s.size(); i++) {
      if (s[i] == 'x' && c) {
        s[i] = 'X';
        c--;
      }
    }
  } else {
    cout << 0 << endl;
  }
  cout << s << endl;
  return 0;
}
