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