#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
inline T max(T &a, U &b) {
  return a > b ? a : b;
}
template <class T, class U>
inline T min(T &a, U &b) {
  return a < b ? a : b;
}
template <class T, class U>
inline T swap(T &a, U &b) {
  T tmp = a;
  a = b;
  b = tmp;
}
const long long INF = (1ll) << 50;
const int mx = 1e5 + 7;
const int mod = 1000000007;
const double pi = 2 * acos(0.0);
int EQ(double d) {
  if (fabs(d) < 1e-7) return 0;
  return d > 1e-7 ? 1 : -1;
}
int main() {
  int n = ({
    int a;
    scanf("%d", &a);
    a;
  }),
      a = 0, b = 0;
  string st;
  cin >> st;
  int len = st.size();
  for (__typeof((len)-1) i = (0); i <= ((len)-1); ++i) {
    if (st[i] == 'x')
      b++;
    else
      a++;
  }
  int cnt = 0;
  for (__typeof((len)-1) i = (0); i <= ((len)-1); ++i) {
    if (a == b) break;
    if (st[i] == 'X' && a > b) {
      st[i] = 'x', a--, b++, cnt++;
    } else if (st[i] == 'x' && a < b) {
      st[i] = 'X', a++, b--, cnt++;
    }
  }
  cout << cnt << endl << st << endl;
}
