#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int c = 0;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'X') {
      c++;
    }
  }
  for (int i = 0; i < n; i++) {
    if (c < n / 2 && s[i] == 'x') {
      c++;
      s[i] = 'X';
      ans++;
    }
    if (c > n / 2 && s[i] == 'X') {
      c--;
      s[i] = 'x';
      ans++;
    }
  }
  cout << ans << "\n";
  cout << s;
}
