#include <bits/stdc++.h>
int main() {
  int n, x_count = 0, X_count = 0, change, change_count, ret;
  char ch[210];
  scanf("%d", &n);
  getchar();
  for (int i = 0; i < n; i++) {
    scanf("%c", &ch[i]);
    if (ch[i] == 'x')
      x_count++;
    else if (ch[i] == 'X')
      X_count++;
  }
  if (x_count == X_count) {
    change = -1;
    printf("0\n");
    for (int i = 0; i < n; i++) printf("%c", ch[i]);
  } else if (x_count > X_count) {
    change = 0;
    change_count = (x_count - X_count) / 2;
  } else if (x_count < X_count) {
    change = 1;
    change_count = (X_count - x_count) / 2;
  }
  if (change == -1)
    return 0;
  else if (change == 0) {
    ret = change_count;
    for (int i = 0; i < n && change_count > 0; i++) {
      if (ch[i] == 'x') {
        ch[i] = 'X';
        change_count--;
      }
    }
    printf("%d\n", ret);
    for (int i = 0; i < n; i++) printf("%c", ch[i]);
  } else if (change == 1) {
    ret = change_count;
    for (int i = 0; i < n && change_count > 0; i++) {
      if (ch[i] == 'X') {
        ch[i] = 'x';
        change_count--;
      }
    }
    printf("%d\n", ret);
    for (int i = 0; i < n; i++) printf("%c", ch[i]);
  }
  return 0;
}
