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