#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, c1, c2;
  char a[203];
  cin >> n >> a;
  c1 = 0;
  c2 = 0;
  for (i = 0; i < n; i++) {
    if (a[i] == 'x')
      c1++;
    else if (a[i] == 'X')
      c2++;
  }
  if (c1 == n / 2 && c2 == n / 2) {
    cout << "0" << endl;
    cout << a;
  } else {
    int c = 1;
    if (c1 > c2) {
      cout << (n / 2) - c2 << endl;
      for (i = 0; i < n; i++) {
        if (a[i] == 'x' && c <= ((n / 2) - c2)) {
          a[i] = 'X';
          c++;
        }
      }
      cout << a;
    } else if (c2 > c1) {
      cout << (n / 2) - c1 << endl;
      for (i = 0; i < n; i++) {
        if (a[i] == 'X' && c <= ((n / 2) - c1)) {
          a[i] = 'x';
          c++;
        }
      }
      cout << a;
    }
  }
  return 0;
}
