#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x = 0, X = 0;
  cin >> n;
  char arr[n];
  int i, c = 0;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] == 'X')
      X++;
    else
      x++;
  }
  if (X == x) {
    cout << 0 << "\n";
    for (i = 0; i < n; i++) cout << arr[i];
  } else {
    cout << abs(n / 2 - max(x, X)) << "\n";
    if (x < X) {
      for (i = 0; i < n; i++) {
        if (arr[i] != 'x') {
          arr[i] = 'x';
          c++;
          if (c == abs(n / 2 - max(x, X))) break;
        }
      }
    } else {
      for (i = 0; i < n; i++) {
        if (arr[i] != 'X') {
          arr[i] = 'X';
          c++;
          if (c == abs(n / 2 - max(x, X))) break;
        }
      }
    }
    for (i = 0; i < n; i++) cout << arr[i];
  }
}
