#include <bits/stdc++.h>
using namespace std;
bool SortbySecDesc(const pair<long long, long long> &a,
                   const pair<long long, long long> &b) {
  return a.second > b.second;
}
bool SortbySecInc(const pair<long long, long long> &a,
                  const pair<long long, long long> &b) {
  return a.second < b.second;
}
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
struct compare {
  bool operator()(const pair<int, int> &value, const int &key) {
    return (value.first < key);
  }
  bool operator()(const int &key, const pair<int, int> &value) {
    return (key < value.first);
  }
};
int String_to_int(string s) {
  stringstream geek(s);
  int ans = 0;
  geek >> ans;
  return ans;
}
int S_I(string s) { return stoi(s); }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  ;
  int n;
  cin >> n;
  long long kos = n / 2;
  string s;
  cin >> s;
  int up = 0, down = 0;
  for (int i = 0; i < n; i++) {
    if (isupper(s[i])) {
      up++;
    } else {
      down++;
    }
  }
  if (up == kos && down == kos) {
    cout << 0 << "\n";
    ;
    cout << s << "\n";
    ;
  } else {
    cout << kos - min(up, down) << "\n";
    ;
    int baki = kos - min(up, down);
    if (up > down) {
      for (int i = 0; i < n && baki != 0; i++) {
        if (isupper(s[i])) {
          s[i] = tolower(s[i]);
          baki--;
        }
      }
      cout << s << "\n";
      ;
    } else {
      for (int i = 0; i < n && baki != 0; i++) {
        if (islower(s[i])) {
          s[i] = toupper(s[i]);
          baki--;
        }
      }
      cout << s << "\n";
      ;
    }
  }
  return 0;
}
