#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  stack<char> cube;
  cube.push(S[0]);
  int ans = 0;
  for (int i = 0; i < S.size(); i++) {
    if (cube.empty() == true)
      cube.push(S[i]);
    else {
      char prev = cube.top();
      cube.push(S[i]);
      if ((prev == '0' && cube.top() == '1') ||
          (prev == '1' && cube.top() == '0')) {
        cube.pop();
        cube.pop();
        ans += 2;
      }
    }
  }
  cout << ans << endl;
}
