#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 0, 0, 1};
const int dy[] = {0, -1, 1, 0};
int x, X;
int n;
int main() {
  x = X = 0;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0, _n = (n); i < _n; i++) {
    if (s[i] == 'x')
      x++;
    else
      X++;
  }
  int cnt = 0;
  for (int i = 0, _n = (n); i < _n; i++) {
    if (x == X && x == n) break;
    if (s[i] == 'x' && x > n / 2) {
      x--;
      X++;
      cnt++;
      s[i] = 'X';
    } else if (s[i] == 'X' && X > n / 2) {
      X--;
      x++;
      cnt++;
      s[i] = 'x';
    }
  }
  cout << cnt << endl;
  cout << s << endl;
  return 0;
}
