#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int a = 0, count = 0, N;
  N = S.size();
  while (1) {
    for (int i = 0; i < N; i++) {
      if (S[i] == '0' && S[i + 1] == '1' || S[i] == '1' && S[i + 1] == '0') {
        a += 2;
        S[i] = '3';
        S[i + 1] = '3';
        i += 2;
      }
    }
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        if (S[j] == '3') {
          count++;
        }
      }
      if (S[i] == '3') {
        S.erase(S.begin() + i);
      }
    }
    if (count == 0) {
      break;
    }
    count = 0;
    N = S.size();
  }
  cout << a << endl;
}
