#include <bits/stdc++.h>
using namespace std;
int main() {
  char b[10000];
  long long a, c = 0, k = 0;
  long long h = 0;
  cin >> a;
  for (int i = 0; i < a; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < a; i++) {
    if (b[i] == 'x') {
      k++;
    }
    if (b[i] == 'X') {
      c++;
    }
  }
  if (k == a / 2 && c == a / 2) {
    cout << "0"
         << "\n";
    for (int i = 0; i < a; i++) {
      cout << b[i];
    }
  }
  if (k < c) {
    cout << (c - k) / 2 << "\n";
    for (int i = 0; i < a; i++) {
      if (b[i] == 'X' && c != a / 2) {
        cout << "x";
        c--;
      } else {
        cout << b[i];
      }
    }
  }
  if (k > c) {
    cout << (k - c) / 2 << "\n";
    for (int i = 0; i < a; i++) {
      if (b[i] == 'x' && k != a / 2) {
        cout << "X";
        k--;
      } else {
        cout << b[i];
      }
    }
  }
}
