#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n, x = 0, X = 0, mint = 0;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'x')
      x++;
    else
      X++;
  }
  if (x == X) {
    cout << 0 << endl;
    cout << s << endl;
  } else {
    if (x > X) {
      for (int i = 0; i < n; i++) {
        if (x == X) break;
        if (s[i] == 'x') {
          s[i] = 'X';
          x--;
          X++;
          mint++;
        }
      }
    } else {
      for (int i = 0; i < n; i++) {
        if (x == X) break;
        if (s[i] == 'X') {
          s[i] = 'x';
          X--;
          x++;
          mint++;
        }
      }
    }
    {
      cout << mint << endl;
      cout << s << endl;
    }
  }
  return 0;
}
