#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  int ans = 0;
  int fal = 0;
  int j;
  cin >> s;
  n = s.length();
  while (1) {
    fal = 0;
    for (int i = 0; i < s.length() - 1; i++) {
      if (s[i] == '1') {
        j = 0;
        while (1) {
          j++;
          if (s[i + j] == '0') {
            ans += 2;
            s[i] = 'a';
            s[i + j] = 'a';
            j++;
            fal = 1;
            break;
          } else if (s[i + j] == '1') {
            break;
          }
        }
      } else if (s[i] == '0') {
        j = 0;
        while (1) {
          j++;
          if (s[i + j] == '1') {
            ans += 2;
            s[i] = 'a';
            s[i + j] = 'a';
            fal = 1;
            break;
          } else if (s[i + j] == '0') {
            break;
          }
        }
      }
    }
    if (fal == 0) break;
  }
  cout << ans << endl;
  return 0;
}
