#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int big = 0;
    int small = 0;
    for (auto it : s) {
      if (it == 'X') {
        big++;
      } else {
        small++;
      }
    }
    int temp = n / 2;
    int x = max(big, small) - temp;
    cout << x << '\n';
    for (auto &it : s) {
      if (x == 0) {
        break;
      }
      if (big > small && it == 'X') {
        it = 'x';
        x--;
      } else if (small > big && it == 'x') {
        it = 'X';
        x--;
      }
    }
    cout << s << '\n';
  }
}
