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