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