#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, num = 0;
  cin >> n;
  char s[201];
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
    if (s[i] == 'x') num++;
  }
  cout << (abs(n / 2 - num)) << endl;
  if (num > n / 2) {
    for (int i = 0; i < n; ++i) {
      if (s[i] == 'x' && num != n / 2) {
        s[i] = 'X';
        num--;
      }
      if (num == n / 2) break;
    }
  } else {
    for (int i = 0; i < n; ++i) {
      if (s[i] == 'X' && num != n / 2) {
        s[i] = 'x';
        num++;
      }
      if (num == n / 2) break;
    }
  }
  for (int i = 0; i < n; ++i) cout << s[i];
  cout << endl;
  return 0;
}
