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