#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  for (;;) {
    bool done = true;
    for (int i = 0, n = s.size() - 1; i < n; i++) {
      if (s[i] ^ s[i + 1] == '0' ^ '1') {
        s[i] = s[i + 1] = ' ';
        i++;
        ans += 2;
        done = false;
      }
    }
    if (done) break;
    s.erase(remove_if(s.begin(), s.end(), [](char c) { return c == ' '; }),
            s.end());
  }
  cout << ans << endl;
}
