#include <bits/stdc++.h>
int main(void) {
  char s[200001];
  scanf("%s", s);
  int n = strlen(s);
  int k = 0;
  char tmp[10];
  for (int i = 0; i < n - 1; i += 2) {
    strncpy(tmp, s + i, 1);
    if (tmp[0] == s[i + 1]) i++;
    k += 2;
  }
  printf("%d", k);
  return 0;
}
