#include <bits/stdc++.h>
using namespace std;
int x;
char ch[300];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> ch[i];
    x += (ch[i] == 'X');
    x -= (ch[i] == 'x');
  }
  cout << abs(x) / 2 << endl;
  if (x < 0) {
    for (int i = 1; i <= n && x; i++)
      if (ch[i] == 'x') {
        ch[i] = 'X';
        x += 2;
      }
  }
  if (x > 0) {
    for (int i = 1; i <= n && x; i++)
      if (ch[i] == 'X') {
        ch[i] = 'x';
        x -= 2;
      }
  }
  for (int i = 1; i <= n; i++) cout << ch[i];
  cout << endl;
  return 0;
}
