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