#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, xc = 0, Xc = 0;
  char a[200];
  scanf("%d", &n);
  int i;
  for (i = 0; i <= n; i++) {
    scanf("%c", &a[i]);
    if (a[i] == 'x')
      xc++;
    else if (a[i] == 'X')
      Xc++;
  }
  int c = abs(Xc - n / 2);
  printf("%d", c);
  if (Xc > n / 2) {
    int count = 0;
    for (i = 0; i < n; i++) {
      if (a[i] == 'X' && count < c) {
        a[i] = 'x';
        count++;
      } else if (count == c)
        break;
    }
  } else if (Xc <= n / 2) {
    int count1 = 0;
    for (i = 0; i < n; i++) {
      if (a[i] == 'x' && count1 < c) {
        a[i] = 'X';
        count1++;
      } else if (count1 == c)
        break;
    }
  }
  for (i = 0; i <= n; i++) printf("%c", a[i]);
  return 0;
}
