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