#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int ans = 0;
  cin >> s;
  int i = 0;
  int n = s.size();
  for (i = 0; i < n - 1; i++) {
    if (s.substr(i, 2) == "01" or s.substr(i, 2) == "10") {
      s.erase(i, 2);
      i = 0;
      n = s.size();
      ans += 2;
    }
    if (s.size() == 0 or s.size() == 1) break;
    if (s == "01" or s == "10") {
      s = "";
      ans += 2;
    }
  }
  cout << ans << endl;
}
