#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000;
const double EPS = 1E-9;
int n, S;
vector<int> A1, A2;
string s;
int main() {
  cin >> n;
  cin >> s;
  for (int i = 0; i < (int)s.size(); ++i) {
    if (s[i] == 'x')
      A1.push_back(i);
    else
      A2.push_back(i);
  }
  if (A1.size() > A2.size()) {
    while (A1.size() > A2.size()) {
      S++;
      A2.push_back(A1.back());
      A1.pop_back();
      if (A1.size() == 0) break;
    }
  } else {
    while (A2.size() > A1.size()) {
      S++;
      A1.push_back(A2.back());
      A2.pop_back();
      if (A2.size() == 0) break;
    }
  }
  for (int i = 0; i < (int)A1.size(); ++i) s[A1[i]] = 'x';
  for (int i = 0; i < (int)A2.size(); ++i) s[A2[i]] = 'X';
  cout << S << endl;
  cout << s << endl;
  return 0;
}
