#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  int c = 0, C = 0, i, n, d;
  string s;
  cin >> n >> s;
  for (i = 0; i < n; i++) {
    if (isupper(s[i]))
      C++;
    else
      c++;
  }
  d = abs(c - C);
  cout << d / 2 << "\n";
  if (c == C)
    cout << s;
  else if (c > C) {
    d = d / 2;
    for (i = 0; i < n; i++) {
      if (islower(s[i]) && d > 0) {
        cout << "X";
        d--;
      } else
        cout << s[i];
    }
  } else {
    d = d / 2;
    for (i = 0; i < n; i++) {
      if (isupper(s[i]) && d > 0) {
        cout << "x";
        d--;
      } else
        cout << s[i];
    }
  }
}
