#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  stack<int> ss;
  ss.push(s[0]);
  for (int i = 1, n = s.size(); i < n; i++) {
    if (s[i] ^ ss.top() == '0' ^ '1') {
      ans++;
    } else {
      ss.push(s[i]);
    }
  }
  cout << ans * 2 << endl;
}
