#include <bits/stdc++.h>
using namespace std;
struct hamsterSquatsResult {
  int totalMove;
  string finalLine;
};
hamsterSquatsResult hamsterSquats(int n, string startLine) {
  hamsterSquatsResult result = {0, ""};
  int countX = 0;
  int countx = 0;
  for (int i = 0; i < startLine.length(); i++) {
    if (startLine[i] == 'X') {
      countX++;
    } else if (startLine[i] == 'x') {
      countx++;
    }
  }
  int totalMove = n / 2 - min(countX, countx);
  result.totalMove = totalMove;
  if (countX > countx) {
    for (int i = 0; i < startLine.length() && totalMove > 0; i++) {
      if (startLine[i] == 'X') {
        startLine[i] = 'x';
        totalMove--;
      }
    }
  } else if (countX < countx) {
    for (int i = 0; i < startLine.length() && totalMove > 0; i++) {
      if (startLine[i] == 'x') {
        startLine[i] = 'X';
        totalMove--;
      }
    }
  }
  result.finalLine = startLine;
  return result;
}
int main() {
  int n;
  string startLine;
  cin >> n;
  cin >> startLine;
  hamsterSquatsResult result = hamsterSquats(n, startLine);
  cout << result.totalMove << '\n';
  cout << result.finalLine << '\n';
  return 0;
}
