#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int N = S.size();
  int count = 0;
  string T;
  bool q;
  while (1) {
    T = "";
    q = true;
    for (int i = 0; i < S.size(); i++) {
      if (S[i] == '0' && S[i + 1] == '1' || S[i] == '1' && S[i + 1] == '0') {
        i++;
        q = false;
        count += 2;
      } else {
        T += S[i];
      }
    }
    if (q) {
      cout << count << endl;
      return 0;
    } else {
      S = T;
    }
  }
}
