#include <bits/stdc++.h>
using namespace std;
inline bool droppable(char c1, char c2) {
  return (c1 == '0' && c2 == '1') || (c1 == '1' && c2 == '0');
}
int main(void) {
  string s;
  cin >> s;
  int ans = 0;
  int l = 0, r = 1;
  vector<bool> dropped(s.size(), false);
  while (r < s.size()) {
    if (droppable(s[l], s[r])) {
      dropped[l] = dropped[r] = true;
      ans += 2;
      r++;
      while (l > 0 && !dropped[l]) l--;
      if (l == 0) {
        l = r;
        r = l + 1;
      }
    } else {
      l++;
      r++;
    }
  }
  cout << ans << endl;
  return 0;
}
