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