#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i = 1, cnt = 0;
  string S;
  cin >> S;
  N = S.size();
  while (i < S.size()) {
    if (S[i] != S[i - 1] && i > 0) {
      cnt += 2;
      S = S.erase(i - 1, 2);
      i -= 1;
      cout << S << endl;
    } else
      ++i;
  }
  cout << cnt << endl;
}
