#include <bits/stdc++.h>
long long cmpfunc(const void* a, const void* b) {
  return (*(long long*)a - *(long long*)b);
}
int main(void) {
  long long int test, i, j, n, count, flag = 0, o1 = 0, o2 = 0, b1, x, m, l,
                                      max, sum2, min, f, c, r, o, sum1, sum = 0,
                                      y, b, count1 = 0, a2[51], b2;
  char a[500000], q[100000], q1[10000];
  scanf("%s", a);
  count = 0;
  j = 0;
  q[0] = a[0];
  q1[0] = a[1];
  count1 = count = 0;
  for (i = 0; i < strlen(a) - 1; i++) {
    if (a[i] == a[i + 1]) {
      count1 += 2;
      i += 2;
    } else {
      if (a[i] != a[i + 1]) {
        count1 += 2;
        i++;
      }
    }
  }
  printf("%lld", count1);
  return 0;
}
