#include <bits/stdc++.h>
using namespace std;
char a[300];
int main() {
  int n;
  cin >> n;
  scanf("%s", a + 1);
  int cnt = 0;
  int cnt1 = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 'X')
      cnt++;
    else
      cnt1++;
  }
  if (cnt == n / 2 and cnt1 == n / 2) {
    cout << 0 << endl;
    printf("%s", a + 1);
    return 0;
  }
  int diff = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 'x' and cnt < n / 2) {
      a[i] = 'X';
      cnt++;
      diff++;
    }
    if (a[i] == 'X' and cnt1 < n / 2) {
      a[i] = 'x';
      cnt1++;
      diff++;
    }
  }
  cout << diff << endl;
  printf("%s", a + 1);
}
