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