#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  getchar();
  string s;
  cin >> s;
  int x = count(s.begin(), s.end(), 'X');
  int y = t - x;
  if (x == y) {
    cout << 0 << endl << s << endl;
    return 0;
  }
  if (x > y) {
    x = x - y;
    x /= 2;
    int h = 0;
    for (int i = 0; s[i] && x > 0; i++) {
      if (s[i] == 'X') {
        s[i] = 'x';
        x--;
        h++;
      }
    }
    cout << h << endl << s << endl;
  } else {
    y = y - x;
    y /= 2;
    int g = 0;
    for (int i = 0; s[i] && y > 0; i++) {
      if (s[i] == 'x') {
        s[i] = 'X';
        y--;
        g++;
      }
    }
    cout << g << endl << s << endl;
  }
  return 0;
}
