#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string str;
  while (cin >> n) {
    cin >> str;
    int cnt = 0;
    for (int i = 0, m = str.length(); i < m; i++) {
      if (str.at(i) == 'X') ++cnt;
    }
    cnt -= n / 2;
    cout << (cnt > 0 ? cnt : -cnt) << endl;
    for (int i = 0, m = str.length(); i < m; i++) {
      if (cnt > 0 && str.at(i) == 'X') {
        str[i] = 'x';
        --cnt;
      } else if (cnt < 0 && str.at(i) == 'x') {
        str[i] = 'X';
        ++cnt;
      }
    }
    cout << str << endl;
  }
  return 0;
}
