#include <bits/stdc++.h>
inline void in(int &MAGNUS) { scanf("%d", &MAGNUS); }
inline void out(int MAGNUS) { printf("%d\n", MAGNUS); }
inline void in(int &MAGNUS, int &CLAR) { scanf("%d%d", &MAGNUS, &CLAR); }
inline void out(int MAGNUS, int CLAR) { printf("%d %d\n", MAGNUS, CLAR); }
inline void inl(long long &LIV) { scanf("%lld", &LIV); }
inline void inl(long long &LIV, long long &MART) {
  scanf("%lld%lld", &LIV, &MART);
}
inline void outl(long long LIV) { printf("%lld\n", LIV); }
inline void outl(long long LIV, long long MART) {
  printf("%lld %lld\n", LIV, MART);
}
using namespace std;
int main() {
  int N;
  in(N);
  char s[205];
  scanf("%s", s + 1);
  int stand = 0, sit = 0;
  for (int i = 1; i <= N; i++)
    if (s[i] == 'X')
      stand++;
    else
      sit++;
  if (stand > sit) {
    out((stand - sit) / 2);
    for (int i = 1; i <= N; i++) {
      if (s[i] == 'x')
        printf("x");
      else if (s[i] == 'X' && stand != sit)
        stand--, sit++, printf("x");
      else
        printf("X");
    }
  } else {
    out((sit - stand) / 2);
    for (int i = 1; i <= N; i++) {
      if (s[i] == 'X')
        printf("X");
      else if (s[i] == 'x' && sit != stand)
        sit--, stand++, printf("X");
      else
        printf("x");
    }
  }
  puts("");
  return 0;
}
