#include <bits/stdc++.h>
using namespace std;
int main() {
  char S[100000];
  fill(S, S + 100000, 2);
  cin >> S;
  int end;
  for (int i = 0; i < 100000; i++) {
    if (S[i] == 2) {
      end = i;
      break;
    }
  }
  int count = 0;
  bool f = true;
  for (int k = 0; k < end; k++) {
    f = true;
    for (int i = 0; i < end; i++) {
      if (S[i] != S[i + 1]) {
        count += 2;
        for (int j = i; j + 2 < end; j++) {
          S[j] = S[j + 2];
        }
      }
      cout << S[i];
    }
    if (S[k] != S[k + 1]) {
      f = false;
      k = 0;
    }
    if (f = true) {
      break;
    }
  }
  cout << count << endl;
  return 0;
}
