#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  long long ans = 0;
  cin >> s;
  while (1) {
    for (long long i = 0; i < s.size() - 1; i++) {
      if (s[i] != s[i + 1]) {
        s.erase(s.begin() + i);
        s.erase(s.begin() + i + 1);
        ans += 2;
        i++;
      }
    }
    if ((s.find("01") == string::npos && s.find("10") == string::npos) ||
        s.size() < 2)
      break;
  }
  cout << ans << endl;
}
