#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char arr[n];
  int imax = 0, imin = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (int(arr[i]) > 97)
      imin++;
    else
      imax++;
  }
  int sum = 0;
  if (imax == imin)
    ;
  else if (imax > imin) {
    sum = (imax - imin) / 2;
    int z = sum;
    int l = 0;
    for (;;) {
      if (int(arr[l]) < 97) {
        arr[l] = tolower(arr[l]);
        z--;
      }
      l++;
      if (z == 0) break;
    }
  } else if (imax < imin) {
    sum = (imin - imax) / 2;
    int m = sum;
    int k = 0;
    for (;;) {
      if (int(arr[k]) > 97) {
        arr[k] = toupper(arr[k]);
        m--;
      }
      k++;
      if (m == 0) break;
    }
  }
  cout << sum << endl;
  for (int i = 0; i < n; i++) {
    cout << arr[i];
  }
  cout << endl;
  return 0;
}
