#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  long long len = S.size();
  stringstream ss;
  string sss;
  while (true) {
    bool f = false;
    for (long long i = 0; i < (long long)S.size() - 1; i += 2) {
      if (S[i] == S[i + 1]) {
        ss << S[i] << S[i + 1];
      }
    }
    if (S.size() % 2 != 0) {
      ss << S[S.size() - 1];
    }
    sss = ss.str();
    ss.str("");
    cout << sss << endl;
    if (sss.size() != S.size()) {
      S = sss;
      continue;
    }
    if (sss.size() > 0) {
      ss << S[0];
    } else {
      break;
    }
    for (long long i = 1; i < (long long)S.size() - 2; i += 2) {
      if (S[i] == S[i + 1]) {
        ss << S[i] << S[i + 1];
      }
    }
    if (S.size() % 2 == 0) {
      ss << S[S.size() - 1];
    }
    sss = ss.str();
    ss.str("");
    cout << sss << endl;
    if (sss.size() != S.size()) {
      S = sss;
      continue;
    }
    break;
  }
  cout << len - sss.size() << endl;
}
