#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string str;
  int cnt = 0;
  bool flag = 0;
  cin >> str;
  while (1) {
    for (int i = 0; i < str.length() - 1; i++) {
      if (str[i] == '0' && str[i + 1] == '1') {
        cnt += 2;
        str.erase(i, 2);
        break;
      } else if (str[i] == '1' && str[i + 1] == '0') {
        cnt += 2;
        str.erase(i, 2);
        break;
      }
      if (i >= str.length() - 2) flag = 1;
    }
    if (str.length() < 2 || flag == 1) break;
  }
  printf("%d", cnt);
  return 0;
}
