#include <bits/stdc++.h>
int main() {
  int n, sml = 0, cap = 0, diff, temp;
  char str[201];
  scanf("%d", &n);
  scanf("%s", str);
  for (int i = 0; i < n; i++) {
    sml++;
    if (str[i] == 'X') cap++, sml--;
  }
  if (sml > cap) {
    diff = sml - cap;
    diff = temp = diff / 2;
    for (int i = 0; i < n && temp; i++)
      if (str[i] == 'x') str[i] = str[i] - 32, temp--;
  } else if (sml < cap) {
    diff = cap - sml;
    diff = temp = diff / 2;
    for (int i = 0; i < n && temp; i++)
      if (str[i] == 'X') str[i] = str[i] + 32, temp--;
  } else
    diff = 0;
  printf("%d\n%s", diff, str);
  return 0;
}
