#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  bool flag = true;
  int ans = 0;
  size_t pos, pos1, pos2, nSize;
  nSize = string("01").size();
  while (1) {
    if (s.size() < 2) {
      break;
    }
    pos1 = s.find("01");
    pos2 = s.find("10");
    if (pos1 == string::npos && pos2 == string::npos) {
      break;
    }
    pos = min(pos1, pos2);
    s.erase(pos, nSize);
    ans += 2;
  }
  cout << ans << endl;
}
