#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int m = n / 2, a = 0, b = 0, i, j;
  for (i = 0; i < n; i++) {
    if (s[i] == 'x')
      a++;
    else
      b++;
  }
  if (a == b) {
    puts("0");
    cout << s << endl;
  } else if (a > b) {
    for (i = 0, j = 0; i < n && j < a - m; i++)
      if (s[i] == 'x') s[i] = 'X', j++;
    cout << a - m << endl;
    cout << s << endl;
  } else {
    for (i = 0, j = 0; i < n && j < b - m; i++)
      if (s[i] == 'X') s[i] = 'x', j++;
    cout << b - m << endl;
    cout << s << endl;
  }
  return 0;
}
