#include <bits/stdc++.h>
using namespace std;
string S;
int main() {
  cin >> S;
  size_t found;
  int cube = 0;
  bool flag1 = true;
  bool flag2 = true;
  while (flag1 || flag2) {
    flag1 = false;
    flag2 = false;
    while ((found = S.find("01")) != string::npos) {
      S.erase(found, 2);
      cube += 2;
      flag1 = true;
    }
    while ((found = S.find("10")) != string::npos) {
      S.erase(found, 2);
      cube += 2;
      flag2 = true;
    }
  }
  cout << cube << endl;
}
