#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, countx = 0, countX = 0;
  string s;
  cin >> n >> s;
  a = n / 2;
  for (int i = 0; i < n; i++) {
    if (s.substr(i, 1) == "x")
      countx++;
    else
      countX++;
  }
  int sum = abs(a - countx);
  cout << sum << endl;
  int cnt;
  string goal, goal1;
  if (countx > countX) {
    goal = "X", goal1 = "x";
    cnt = countX;
  } else {
    goal = "x", goal1 = "X";
    cnt = countx;
  }
  if (cnt == a) {
    cout << s;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (cnt == a) {
      cout << s;
      return 0;
    }
    if (s.substr(i, 1) == goal1) {
      s.replace(i, 1, goal);
      cnt++;
    }
  }
  return 0;
}
