#include <bits/stdc++.h>
using namespace std;
int n;
char s[300];
int main() {
  scanf("%d", &n);
  scanf("%s", s);
  int cntX = 0;
  int cntx = 0;
  for (int i = 0; i < n; i++)
    if (s[i] == 'X')
      cntX++;
    else
      cntx++;
  int cut = cntX - cntx;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (cut < 0 && s[i] == 'x') {
      cut += 2;
      s[i] = 'X';
      cnt++;
    } else if (cut > 0 && s[i] == 'X') {
      cut -= 2;
      s[i] = 'x';
      cnt++;
    }
  }
  printf("%d\n", cnt);
  for (int i = 0; i < n; i++) printf("%c", s[i]);
  printf("\n");
  return 0;
}
