#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:20000000")
using namespace std;
int ri() {
  int x;
  scanf("%d", &x);
  return x;
}
long long rll() {
  long long x;
  scanf("%lld", &x);
  return x;
}
void solve() {
  int n = ri();
  int need = n / 2;
  string s;
  cin >> s;
  vector<int> a, b;
  for (int i = (int)(0); i <= (int)(n - 1); i++)
    if (s[i] == 'x')
      a.push_back(i);
    else
      b.push_back(i);
  int res = 0;
  while (a.size() < need) {
    res++;
    s[b.back()] = 'x';
    a.push_back(b.back());
    b.pop_back();
  }
  while (b.size() < need) {
    res++;
    s[a.back()] = 'X';
    b.push_back(a.back());
    a.pop_back();
  }
  cout << res << endl;
  cout << s << endl;
}
int main() {
  solve();
  return 0;
}
