#include <bits/stdc++.h>
using namespace std;
const double eps = 1.0e-11;
const double pi = acos(-1.0);
int main() {
  ios_base::sync_with_stdio(0);
  int n, c = 0;
  string s;
  cin >> n >> s;
  for (long long i = 0; i < n; i++) c += s[i] == 'X';
  cout << abs(n / 2 - c) << endl;
  c = n / 2 - c;
  for (long long i = 0; i < n; i++) {
    if (c < 0 && s[i] == 'X') s[i] = 'x', ++c;
    if (c > 0 && s[i] == 'x') s[i] = 'X', --c;
  }
  cout << s << endl;
  return 0;
}
