#include <bits/stdc++.h>
int main() {
  using namespace std;
  int n;
  cin >> n;
  string position;
  cin >> position;
  int X = 0;
  for (int i = 0; i < position.length(); i++) {
    if (position[i] == 'X') {
      X++;
    }
  }
  if (X > n / 2) {
    cout << X - n / 2 << "\n";
    for (int i = 0; i < n; i++) {
      if (position[i] == 'X' && X > n / 2) {
        cout << 'x';
        X--;
      } else
        cout << position[i];
    }
  } else if (X < n / 2) {
    cout << n / 2 - X << "\n";
    for (int i = 0; i < n; i++) {
      if (position[i] == 'x' && X < n / 2) {
        cout << 'X';
        X++;
      } else
        cout << position[i];
    }
  } else {
    cout << 0 << "\n";
    cout << position;
  }
}
