#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxn = 2e5 + 6;
string str;
int main() {
  int n;
  cin >> n;
  cin >> str;
  int k = 0;
  for (int i = 0; i < n - 2; i++) {
    if (str[i] == str[i + 1] && str[i] == str[i + 2]) {
      int len = 3;
      while (i + len < n && str[i + len] == str[i]) len++;
      str.erase(i, len - 2);
      k += len - 2;
      n -= len - 2;
      i++;
    }
  }
  for (int i = 0; i < n - 1;) {
    if (str[i] == str[i + 1] && n % 2) {
      k += 1;
      str.erase(i, 1);
      n -= 1;
      i += 2;
    } else if (str[i] == str[i + 1] && n % 2 == 0) {
      int len = 3;
      while (len + i < n - 1 && str[i + len] != str[i + len + 1]) len += 2;
      k += 2;
      str.erase(i, 1);
      if (i == n - 2)
        str.erase(i, 1);
      else
        str.erase(i + len - 1, 1);
      n -= 2;
      i += len - 1;
    } else
      i += 2;
  }
  if (n % 2) k++, str.erase(n - 1, 1);
  cout << k << "\n" << str;
  return 0;
}
