#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, count = 0, count2 = 0;
  string s;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'X') {
      count2++;
      if (count2 > n / 2) {
        s[i] = 'x';
      }
    } else if (s[i] == 'x') {
      count++;
      if (count > n / 2) {
        s[i] = 'X';
      }
    }
  }
  cout << abs(n / 2 - count) << endl;
  cout << s << endl;
  return 0;
}
