#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char *argv[]) {
  string str;
  cin >> str;
  int size = str.size();
  int i;
  int check;
  int num = 0;
  while (1) {
    for (int i = 0; i < size; i++) {
      if (((str[i] == '0') && (str[i + 1] == '1')) ||
          ((str[i] == '1') && (str[i + 1] == '0'))) {
        num = num + 2;
        str[i] = 'X';
        str[i + 1] = 'X';
        check = 1;
      }
      str.erase(std::remove(str.begin(), str.end(), 'X'), str.end());
      size = str.size();
    }
    if (check != 1) {
      break;
    } else {
      check = 0;
    }
  }
  std::cout << num;
  return 0;
}
