#include <bits/stdc++.h>
using namespace std;
typedef vector<vector<int>> graph;
ifstream in("buffcraft.in", ios::in);
ofstream out("buffcraft.out", ios::out);
int main() {
  int n;
  cin >> n;
  n /= 2;
  string s;
  cin >> s;
  int p = 0, m = 0;
  for (int i = 0; i < s.size(); ++i)
    if (s[i] == 'x')
      p++;
    else
      m++;
  int z = max(p, m) - n;
  cout << z << endl;
  int i = 0;
  if (p > m)
    while (z > 0 || i < s.size()) {
      if (s[i] == 'x') {
        if (z < 1) {
          cout << s[i];
          i++;
          continue;
        }
        cout << 'X';
        z--;
        i++;
      } else {
        cout << s[i];
        i++;
      }
    }
  else
    while (z > 0 || i < s.size()) {
      if (s[i] == 'X') {
        if (z < 1) {
          cout << s[i];
          i++;
          continue;
        }
        cout << 'x';
        z--;
        i++;
      } else {
        cout << s[i];
        i++;
      }
    }
}
