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