#include <bits/stdc++.h>
using namespace std;
int main() {
  queue<int> a;
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '1')
      a.push(1);
    else
      a.push(0);
  }
  int os = 0;
  int ans = 0;
  while (a.size() != os) {
    os = a.size();
    for (int i = (0); i < (os); ++i) {
      int l, m;
      l = a.front();
      a.pop();
      m = a.front();
      if (l == m) {
        a.push(l);
      } else {
        a.pop();
        ans++;
      }
    }
  }
  cout << ans * 2 << endl;
}
