#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int sit = 0, stand = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'X')
      stand++;
    else if (s[i] == 'x')
      sit++;
  }
  int j = 0;
  if (sit > stand) {
    cout << abs(n / 2 - stand) << "\n";
    while (stand != n / 2) {
      if (s[j] == 'x') {
        s[j] = 'X';
        stand++;
      }
      j++;
    }
    cout << s;
  } else if (sit < stand) {
    j = 0;
    cout << abs(n / 2 - stand) << "\n";
    while (sit != n / 2) {
      if (s[j] == 'X') {
        s[j] = 'x';
        sit++;
      }
      j++;
    }
    cout << s;
  } else
    cout << 0 << endl << s;
}
