#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int N = S.length();
  int k = 0;
  int t = 0;
  int l = 0;
  while (k < N) {
    if ((S[k] == '0' && S[k + 1] == '1') || (S[k] == '1' && S[k + 1] == '0')) {
      for (int j = k; j < N; j++) {
        S[j] = S[j + 2];
      }
      l += 2;
      k -= 1;
    } else {
      k += 1;
    }
  }
  cout << l << endl;
  return 0;
}
