#include <bits/stdc++.h>
using namespace std;
int n;
char s[205];
int main() {
  scanf("%d", &n);
  scanf("%s", s);
  int a = 0, b = 0;
  for (int i = 0; i < n; i++)
    if (s[i] == 'x')
      a++;
    else
      b++;
  int mi = 0;
  if (a < b) {
    int i = 0;
    while (2 * a < n) {
      if (s[i] == 'X') {
        s[i] = 'x';
        a++;
        b--;
        mi++;
      }
      i++;
    }
  } else {
    int i = 0;
    while (2 * b < n) {
      if (s[i] == 'x') {
        s[i] = 'X';
        b++;
        a--;
        mi++;
      }
      i++;
    }
  }
  printf("%d\n", mi);
  for (int i = 0; i < n; i++) printf("%c", s[i]);
  printf("\n");
  return 0;
}
