#include <bits/stdc++.h>
using namespace std;
int main() {
  int T = 1;
  while (T--) {
    int n;
    std::cin >> n;
    ;
    std::string s;
    std::cin >> s;
    ;
    int cnt = 0;
    std::vector<int> stand, sit;
    for (int i = 0; i < n; ++i) {
      if (s[i] == 'X') {
        cnt++;
        stand.push_back(i);
      } else {
        sit.push_back(i);
      }
    }
    if (cnt > (n / 2)) {
      std::cout << cnt - (n / 2) << std::endl;
      ;
      for (int i = 0; i < (cnt - (n / 2)); ++i) {
        s[stand[i]] = 'x';
      }
    } else {
      std::cout << (n / 2) - cnt << std::endl;
      ;
      for (int i = 0; i < (n / 2) - cnt; ++i) {
        s[sit[i]] = 'X';
      }
    }
    std::cout << s << std::endl;
    ;
  }
  return 0;
}
