#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0;
  cin >> n;
  string s;
  cin >> s;
  int sit = 0, stand = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'x')
      sit++;
    else
      stand++;
  }
  if (sit >= n / 2) {
    cout << sit - n / 2 << endl;
    for (int i = 0; i < n; i++) {
      if (count == sit - n / 2) break;
      if (s[i] == 'x') {
        s[i] = 'X';
        count++;
      }
    }
    cout << s;
  } else {
    cout << stand - n / 2 << endl;
    for (int i = 0; i < n; i++) {
      if (count == stand - n / 2) break;
      if (s[i] == 'X') {
        s[i] = 'x';
        count++;
      }
    }
    cout << s;
  }
}
