#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string s;
  cin >> s;
  int cnt = 0, ans = 0;
  if (s[0] == '0') {
    for (int i = 0; i < s.size(); ++i) {
      if (s[i] == '0') {
        ++cnt;
      } else if (cnt > 0) {
        --cnt;
        ans = ans + 2;
      }
    }
  } else {
    for (int i = 0; i < s.size(); ++i) {
      if (s[i] == '1') {
        ++cnt;
      } else if (cnt > 0) {
        --cnt;
        ans = ans + 2;
      }
    }
  }
  cout << ans << endl;
}
