#include <bits/stdc++.h>
using namespace std;
int n, bo, b;
string s;
int main() {
  cin >> n;
  cin >> s;
  for (int i = 0; i < s.length(); i++)
    if (s[i] <= 122 && s[i] >= 97)
      b++;
    else
      bo++;
  if (bo == b) {
    cout << 0 << endl;
    cout << s << endl;
    return 0;
  }
  cout << max(bo, b) - s.length() / 2 << endl;
  if (bo < b)
    for (int i = 0; i < s.length() && bo < s.length() / 2; i++)
      if (s[i] <= 122 && s[i] >= 97) s[i] = s[i] - 97 + 65, bo++, b--;
  if (b < bo)
    for (int i = 0; i < s.length() && b < s.length() / 2; i++)
      if (!(s[i] <= 122 && s[i] >= 97)) s[i] = s[i] - 65 + 97, b++, bo--;
  cout << s;
  cout << "\n";
  return 0;
}
