#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  while (s.find("01") != -1 || s.find("10") != -1) {
    int k = s.find("01");
    if (k >= 0) {
      ans += 2;
      s = s.substr(0, k) + s.substr(k + 2);
    }
    k = s.find("10");
    if (k >= 0) {
      ans += 2;
      s = s.substr(0, k) + s.substr(k + 2);
    }
  }
  cout << ans << endl;
  return 0;
}
