#include <bits/stdc++.h>
using namespace std;
long long a[10001], b, d, sum, i, n, resh, ans1, ans2, ans3, ans4;
string s, s1;
char c[10001];
int main() {
  cin >> n;
  if (n % 2 == 0) {
    resh = n / 2;
  }
  for (i = 0; i < n; ++i) {
    cin >> c[i];
    if (c[i] == 'X') {
      ans1++;
    }
    if (c[i] == 'x') {
      ans2++;
    }
  }
  if (ans1 == ans2) {
    cout << 0 << endl;
    for (i = 0; i < n; ++i) {
      cout << c[i];
    }
    return 0;
  }
  if (ans1 > ans2) {
    for (i = 0; i < n; i++) {
      if (ans1 > ans2) {
        if (c[i] != 'x') {
          c[i] = tolower(c[i]);
          ans1--;
          ans2++;
          ans3++;
        }
      } else
        break;
    }
    cout << ans3 << endl;
    for (i = 0; i < n; ++i) {
      cout << c[i];
    }
    return 0;
  }
  if (ans1 < ans2) {
    for (i = 0; i < n; i++) {
      if (ans1 < ans2) {
        if (c[i] != 'X') {
          c[i] = toupper(c[i]);
          ans2--;
          ans1++;
          ans4++;
        }
      } else
        break;
    }
    cout << ans4 << endl;
    for (i = 0; i < n; ++i) {
      cout << c[i];
    }
    return 0;
  }
}
