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