#include <bits/stdc++.h>
using namespace std;
string S;
int res = 0;
int deleteCube(int index) {
  int i;
  for (i = index + 2; S[i] != '\0'; ++i) {
    S[i - 2] = S[i];
  }
  S[i - 2] = '\0';
  return 0;
}
bool searchCube() {
  for (int i = 0; S[i] != '\0'; ++i) {
    if ((S[i] == '0' and S[i + 1] == '1') or
        (S[i] == '1' and S[i + 1] == '0')) {
      deleteCube(i);
      res += 2;
      return true;
    }
  }
  return false;
}
int main() {
  cin >> S;
  while (true) {
    if (!searchCube()) break;
  }
  cout << res << endl;
  return 0;
}
