#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cn = n / 2;
  int u = 0;
  for (size_t i = 0; i < s.size(); i++) {
    if (isupper(s[i])) u++;
  }
  if (u == cn) {
    cout << 0 << endl;
    cout << s << endl;
  } else if (u < cn) {
    int cl = 0;
    for (int i = 0; i < s.size(); i++) {
      if (u == cn) break;
      if (islower(s[i])) {
        s[i] = toupper(s[i]);
        cl++;
        u++;
      }
    }
    cout << cl << endl;
    cout << s << endl;
  } else if (u > cn) {
    int ch = 0;
    for (int i = 0; i < s.size(); i++) {
      if (u == cn) break;
      if (isupper(s[i])) {
        s[i] = tolower(s[i]);
        ch++;
        u--;
      }
    }
    cout << ch << endl;
    cout << s << endl;
  }
  cin.ignore();
  cin.get();
  return 0;
}
