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