#include <bits/stdc++.h>
using namespace std;
int num;
char t;
char tm[500];
int main() {
  while (scanf("%d", &num) != EOF) {
    int m;
    int n;
    int ans;
    m = 0;
    n = 0;
    scanf("%s", tm);
    for (int i = 0; i < num; i++) {
      if (tm[i] == 'x') {
        m++;
      } else if (tm[i] == 'X') {
        n++;
      }
    }
    if (n == m) {
      printf("0\n");
      printf("%s", tm);
      printf("\n");
      continue;
    } else if (n > m) {
      int j = 0;
      ans = n - num / 2;
      while (ans) {
        if (tm[j] == 'X') {
          tm[j] = 'x';
          ans--;
        }
        j++;
      }
    } else if (m > n) {
      int j = 0;
      ans = m - num / 2;
      while (ans) {
        if (tm[j] == 'x') {
          tm[j] = 'X';
          ans--;
        }
        j++;
      }
    }
    int tt = max(n, m) - num / 2;
    printf("%d\n", tt);
    printf("%s", tm);
    printf("\n");
  }
  return 0;
}
