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