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