#include <bits/stdc++.h>
using namespace std;
int b[201];
int main() {
  int n;
  char a[201];
  while (cin >> n) {
    int sum = 0;
    memset(b, 0, sizeof(b));
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (int i = 0; i < n; i++) {
      if (a[i] == 'X') b[i] = 1;
    }
    for (int i = 0; i < n; i++) sum += b[i];
    if (sum == (n / 2)) {
      printf("0\n");
      for (int i = 0; i < n; i++) printf("%c", a[i]);
      printf("\n");
    } else if (sum > (n / 2)) {
      int counts = sum - (n / 2);
      printf("%d\n", counts);
      for (int i = 0; i < n; i++) {
        if (a[i] == 'X' && counts) {
          printf("x");
          counts--;
          continue;
        }
        printf("%c", a[i]);
      }
      printf("\n");
    } else if (sum < (n / 2)) {
      int counts = (n / 2) - sum;
      printf("%d\n", counts);
      for (int i = 0; i < n; i++) {
        if (a[i] == 'x' && counts) {
          printf("X");
          counts--;
          continue;
        }
        printf("%c", a[i]);
      }
      printf("\n");
    }
  }
  return 0;
}
