#include <bits/stdc++.h>
using namespace std;
int main() {
  int box = 0;
  string S;
  cin >> S;
  int itr1 = (int)S.find("01");
  int itr2;
  do {
    while (itr1 != -1) {
      S.erase(S.begin() + itr1, S.begin() + itr1 + 2);
      itr1 = (int)S.find("01", itr1);
      box += 2;
    }
    itr2 = (int)S.find("10");
    while (itr2 != -1) {
      S.erase(S.begin() + itr2, S.begin() + itr2 + 2);
      itr2 = (int)S.find("01", itr2);
      box += 2;
    }
    itr1 = (int)S.find("01");
    itr2 = (int)S.find("10");
  } while (itr1 != -1 or itr2 != -1);
  cout << box << endl;
  return 0;
}
