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