#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int st = 0, sd = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'x')
      st++;
    else
      sd++;
  }
  int c = 0, c2 = 0;
  if (st > n / 2) {
    for (int i = 0; i < n; i++) {
      if (s[i] == 'x' && c2 < st - n / 2) {
        s[i] = 'X';
        c2++;
      }
    }
    cout << (st - n / 2) << "\n";
    cout << s;
  } else {
    for (int i = 0; i < n; i++) {
      if (s[i] == 'X' && c < sd - n / 2) {
        s[i] = 'x';
        c++;
      }
    }
    cout << (sd - n / 2) << "\n";
    cout << s;
  }
}
