#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt[2] = {0, 0}, t, ans = 0;
  string txt;
  bool flag = 0;
  cin >> n >> txt;
  for (int i = 0; i < n; ++i) {
    if (txt[i] == 'x')
      cnt[0]++;
    else
      cnt[1]++;
  }
  if (cnt[0] < cnt[1])
    flag = 0;
  else
    flag = 1;
  t = n / 2;
  for (int i = 0; i < n; ++i) {
    if (cnt[flag] == t) break;
    if (flag == 1 && txt[i] == 'x')
      txt[i] = 'X', cnt[flag]++, ans++;
    else if (flag == 0 && txt[i] == 'X')
      txt[i] = 'x', cnt[flag]++, ans++;
  }
  cout << ans << endl;
  for (int i = 0; i < n; ++i) cout << txt[i];
  return 0;
}
