#include <bits/stdc++.h>
using namespace std;
const int MAXN = 101;
int main() {
  int n;
  while (cin >> n) {
    string s;
    cin >> s;
    int c = 0;
    for (int i = 0; i < n; i++) {
      c += (s[i] == 'x');
    }
    cout << abs(n / 2 - c) << endl;
    if (c < n / 2) {
      for (int i = 0; i < n && c < n / 2; i++) {
        if (s[i] == 'X') {
          s[i] = 'x';
          c++;
        }
      }
    } else {
      for (int i = 0; i < n && c > n / 2; i++) {
        if (s[i] == 'x') {
          s[i] = 'X';
          c--;
        }
      }
    }
    cout << s << endl;
  }
  return 0;
}
