#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  getchar();
  string s;
  cin >> s;
  int small = 0, big = 0;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'x')
      small++;
    else
      big++;
  }
  for (int i = 0; i < n; i++) {
    if (big < small && s[i] == 'x') {
      s[i] = 'X';
      cnt++;
      big++;
      small--;
    } else if (small < big && s[i] == 'X') {
      s[i] = 'x';
      cnt++;
      small++;
      big--;
    }
  }
  cout << cnt << endl;
  cout << s << endl;
  return 0;
}
