#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, j, k, l, c, flag;
  string s1, s2;
  cin >> s1;
  flag = 1;
  c = 0;
  s2 = "";
  while (flag == 1) {
    flag = 0;
    for (i = 0; i < s1.size(); i++) {
      if (i == (s1.size() - 1)) {
        s2.push_back(s1[i]);
      } else if (s1[i] == '0' && s1[i + 1] == '1') {
        flag = 1;
        c++;
        i++;
      } else if (s1[i] == '1' && s1[i + 1] == '0') {
        flag = 1;
        c++;
        i++;
      } else if (s1[i] == '0' && s1[i + 1] == '0') {
        s2.push_back(s1[i]);
      } else if (s1[i] == '1' && s1[i + 1] == '1') {
        s2.push_back(s1[i]);
      }
    }
    s1 = s2;
    s2.clear();
  }
  c *= 2;
  cout << c << endl;
  return 0;
}
