#include <bits/stdc++.h>
int main() {
  int n, i = 0, j = 0, count1 = 0, d, cou = 0, count2 = 0;
  scanf("%d\n", &n);
  char c[n];
  gets(c);
  while (c[i] != '\0') {
    if (c[i] == 'x')
      count1++;
    else
      count2++;
    i++;
  }
  if (count1 == count2) {
    printf("0\n");
    puts(c);
  } else if (count1 > count2) {
    d = count1 - count2;
    printf("%d\n", (d / 2));
    while (cou < (d / 2)) {
      if (c[j] == 'x') {
        c[j] = 'X';
        cou++;
      }
      j++;
    }
    puts(c);
  } else {
    d = count2 - count1;
    printf("%d\n", (d / 2));
    while (cou < (d / 2)) {
      if (c[j] == 'X') {
        c[j] = 'x';
        cou++;
      }
      j++;
    }
    puts(c);
  }
  return 0;
}
