#include <bits/stdc++.h>
char s[100001];
int is_removed(char s[], int n) {
  for (int i = 1; i < n; i++) {
    if ((s[i - 1] == '0' && s[i] == '1') ||
        (s[i - 1] == '1') && (s[i] == '0')) {
      return 1;
    }
  }
  return 0;
}
void remove(char s[], int *n) {
  for (int i = 1; i < *n; i++) {
    if ((s[i - 1] == '0' && s[i] == '1') ||
        (s[i - 1] == '1') && (s[i] == '0')) {
      for (int j = i + 1; j < *n; j++) {
        s[j - 2] = s[j];
      }
      *n = *n - 2;
      return;
    }
  }
}
int main(void) {
  int length, count = 0;
  scanf("%s", s);
  length = strlen(s);
  while (is_removed(s, length)) {
    remove(s, &length);
    count += 2;
  }
  printf("%d\n", count);
  return 0;
}
