#include <bits/stdc++.h>
using namespace std;
int main(void) {
  char s[100000];
  stack<int> box;
  scanf("%s", s);
  int banhei = 0;
  int i = 0, res = 0;
  while (s[i] != '\0') {
    if (banhei >= 1 && box.top() != s[i] - '0') {
      box.pop();
      res += 2;
      banhei--;
    } else {
      if (s[i] == '1') {
        box.push(1);
      } else {
        box.push(0);
      }
      banhei++;
    }
    i++;
  }
  printf("%d\n", res);
  return 0;
}
