#include <bits/stdc++.h>
int main() {
  char a[210];
  char b, c;
  int i, j, x = 0, k, l, p = 0, q = 0, n, m;
  scanf("%d", &n);
  scanf("%s", &a);
  l = strlen(a);
  for (i = 0; i < l; i++) {
    if (a[i] == 'X')
      p++;
    else
      q++;
  }
  if (p > q) {
    while (p > q) {
      p--;
      q++;
      x++;
    }
    m = x;
    for (i = 0; x > 0; i++) {
      if (a[i] == 'X') {
        a[i] = 'x';
        x--;
      }
    }
  } else {
    while (q > p) {
      q--;
      p++;
      x++;
    }
    m = x;
    for (i = 0; x > 0; i++) {
      if (a[i] == 'x') {
        a[i] = 'X';
        x--;
      }
    }
  }
  printf("%d\n", m);
  puts(a);
  return 0;
}
