#include <bits/stdc++.h>
int main(void) {
  char s[100000];
  scanf("%s", s);
  int len;
  len = strlen(s);
  int i, j;
  int cnt = 0;
  for (i = 0; i < len; i++) {
    if ((s[i] == '0' && s[i + 1] == '1') || (s[i] == '1' && s[i + 1] == '0')) {
      cnt++;
      for (j = i; j < len; j += 2) {
        if (s[j + 2] != '\0') {
          s[j] = s[j + 2];
        } else {
          s[j] = '\0';
          break;
        }
        if (s[j + 3] != '\0') {
          s[j + 1] = s[j + 3];
        } else {
          s[j + 1] = '\0';
          break;
        }
      }
      i--;
      len -= 2;
    }
  }
  printf("%d\n", cnt * 2);
  return 0;
}
