#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  char pre_flag = s[0];
  queue<char> q;
  int count = 0;
  int flag = 0;
  for (int i = 1; i < s.size(); i++) {
    if (pre_flag == '0') {
      if (s[i] == '1') {
        count += 2;
      } else {
        q.push(pre_flag);
        flag = -1;
      }
    } else {
      if (s[i] == '0') {
        count += 2;
      } else {
        q.push(pre_flag);
        flag = -1;
      }
    }
  }
  cout << count << endl;
}
