#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  bool flag;
  if (s[0] == '0')
    flag = true;
  else
    flag = false;
  int ans = 0;
  bool judge = true;
  while (judge) {
    if (flag) {
      for (int i = 0; i <= s.length(); i++) {
        if (i == s.length()) {
          judge = false;
          break;
        }
        if (s[i] == '0') continue;
        s.erase(s.begin() + i - 1, s.begin() + i + 1);
        ans += 2;
        if (s[0] == '0')
          flag = true;
        else
          flag = false;
        break;
      }
    } else {
      for (int i = 0; i <= s.length(); i++) {
        if (i == s.length()) {
          judge = false;
          break;
        }
        if (s[i] == '1') continue;
        s.erase(s.begin() + i - 1, s.begin() + i + 1);
        ans += 2;
        if (s[0] == '0')
          flag = true;
        else
          flag = false;
        break;
      }
    }
  }
  cout << ans << endl;
}
