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