#include <bits/stdc++.h>
using namespace std;
int cube[100000 + 1] = {0};
int main() {
  int i, k, len;
  char S[100000 + 1];
  cin >> S;
  for (i = 0; S[i] != '\0'; i++) {
    if (S[i] == '0')
      cube[i] = 1;
    else
      cube[i] = -1;
  }
  len = i;
  int sum = 0, flag;
  do {
    flag = 1;
    for (i = 0; cube[i] != 0; i++) {
      if (cube[i] * cube[i + 1] == -1) {
        sum += 2;
        cube[i] = 0;
        cube[i + 1] = 0;
        i++;
        flag = 0;
      }
    }
    for (i = 0; i < len; i++) {
      if (cube[i] == 0) {
        for (k = i + 1; k < len; k++)
          if (cube[k] != 0) break;
        if (k == 100000) break;
        cube[i] = cube[k];
        cube[k] = 0;
      }
    }
  } while (!flag);
  cout << sum << endl;
  return 0;
}
