#include <bits/stdc++.h>
using namespace std;
int main() {
  int count = 0;
  char s[100000];
  for (int i = 1; i <= 100000; ++i) {
    cin >> s[i];
  }
  for (int i = 1; i < 100000; ++i) {
    if ((s[i] == '0' && s[i + 1] == '1') || (s[i] == '1' && s[i + 1] == '0')) {
      count += 2;
      i += 1;
    }
  }
  cout << count << endl;
}
