#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int maxn = (int)1e5 + 10;
const int mod = (int)1e9 + 7;
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
int dy[] = {1, -1, 0, 0, 1, -1, -1, 1};
long long a, b, c, d, i, j, k, l, t, n, m, p, cs, kk, q, r, s;
char h[1000], o;
double e, f, g;
vector<long long> u, v, w;
vector<pair<long long, long long> > pv;
pair<long long, long long> pp;
string x, y, z;
map<string, long long> mm;
int main() {
  while (cin >> a) {
    cin >> x;
    b = 0;
    c = 0;
    for (i = 0; i < (((x).size())); i++) {
      if (x[i] == 'x')
        b++;
      else
        c++;
    }
    d = a / 2;
    if (b > c) {
      cout << b - d << endl;
      for (i = 0; i < (((x).size())); i++) {
        if (x[i] == 'x' && d > c) {
          cout << 'X';
          c++;
        } else
          cout << x[i];
      }
      printf("\n");
    } else {
      cout << c - d << endl;
      for (i = 0; i < (((x).size())); i++) {
        if (x[i] == 'X' && d > b) {
          cout << 'x';
          b++;
        } else
          cout << x[i];
      }
      printf("\n");
    }
  }
  return 0;
}
