#include <bits/stdc++.h>
const unsigned long long int M = 1000000007;
using namespace std;
long long power(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = x * res;
    y = y >> 1;
    x = x * x;
  }
  return res;
}
long long power(long long x, long long y, long long mod) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = x * res % mod;
    y = y >> 1;
    x = x * x % mod;
  }
  return res;
}
void nik() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
signed main() {
  nik();
  long long test = 1;
  while (test--) {
    long long n;
    string s;
    cin >> n >> s;
    long long x = 0, y = 0;
    for (char ch : s) {
      if (ch == 'x')
        x++;
      else
        y++;
    }
    if (x > y) {
      cout << x - n / 2 << "\n";
      long long t = x - n / 2;
      for (long long i = 0; i < n; i++) {
        if (s[i] == 'x' and t > 0) {
          cout << 'X', t--;
          continue;
        }
        cout << s[i];
      }
    } else if (x < y) {
      cout << y - n / 2 << "\n";
      long long t = y - n / 2;
      for (long long i = 0; i < n; i++) {
        if (s[i] == 'X' and t > 0) {
          cout << 'x', t--;
          continue;
        }
        cout << s[i];
      }
    } else
      cout << "0\n" << s << "\n";
  }
  return 0;
}
