#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, c1, c2, req, k, req1;
  cin >> n;
  string s, s1;
  cin >> s;
  s1 = "xX";
  c1 = count(s.begin(), s.end(), s1[0]);
  c2 = count(s.begin(), s.end(), s1[1]);
  k = n / 2;
  if (c1 > c2) {
    req = abs(k - c1);
    req1 = req;
    for (i = 0; i<n, req1> 0; i++) {
      if (s[i] == 'x') {
        s[i] = 'X';
        req1 = req1 - 1;
      }
    }
  } else if (c1 < c2) {
    req = abs(k - c2);
    req1 = req;
    for (i = 0; i<n, req1> 0; i++) {
      if (s[i] == 'X') {
        s[i] = 'x';
        req1 = req1 - 1;
      }
    }
  } else if (c1 = c2) {
    req = 0;
  }
  cout << req << "\n";
  cout << s;
}
