#include <bits/stdc++.h>
using namespace std;
long long n;
char c[5000];
long long k, ans;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  cin >> c;
  for (long long i = 0; i < n; i++) {
    if (c[i] == 'X') k++;
  }
  ans = abs(k - n / 2);
  cout << ans << endl;
  for (long long i = 0; i < n; i++) {
    if (k < n / 2 && c[i] == 'x') {
      c[i] = 'X';
      k++;
    }
    if (k > n / 2 && c[i] == 'X') {
      c[i] = 'x';
      k--;
    }
    cout << c[i];
  }
}
