#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans1 = 0, ans = 0, sum = 0, ans2 = 0, ans3 = 0;
  char a = 'x', b = 'X', c[300];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  for (int i = 0; i < n; i++) {
    if (c[i] == a) {
      ans++;
      ans2++;
    }
    if (c[i] == b) {
      ans1++;
      ans3++;
    }
  }
  if (ans == n / 2) {
    cout << 0 << endl;
    for (int i = 0; i < n; i++) {
      cout << c[i];
    }
    return 0;
  }
  if (ans > ans1) {
    while (ans != n / 2) {
      ans--;
      sum++;
    }
  }
  if (ans < ans1) {
    while (ans1 != n / 2) {
      ans1--;
      sum++;
    }
  }
  cout << sum << endl;
  for (int i = 0; i < n; i++) {
    if (c[i] == b && sum > 0 && ans2 < ans3) {
      c[i] = a;
      sum--;
    }
  }
  for (int i = 0; i < n; i++) {
    if (c[i] == a && sum > 0 && ans2 > ans3) {
      c[i] = b;
      sum--;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << c[i];
  }
  return 0;
}
