#include <bits/stdc++.h>
using namespace std;
static const int INF = 500000000;
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
template <class T>
void chmin(T& a, const T& b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T& a, const T& b) {
  if (a < b) a = b;
}
int n;
char s[205];
int main() {
  cin >> n;
  scanf("%s", s);
  int cnt = 0;
  for (int i = 0; i < (n); ++i)
    if (s[i] == 'X') ++cnt;
  int dif = cnt - n / 2;
  printf("%d\n", abs(dif));
  if (dif > 0) {
    for (int i = 0; i < n && dif > 0; ++i)
      if (s[i] == 'X') s[i] = 'x', --dif;
  } else
    for (int i = 0; i < n && dif < 0; ++i) {
      if (s[i] == 'x') s[i] = 'X', ++dif;
    }
  printf("%s\n", s);
  return 0;
}
