#include <bits/stdc++.h>
using namespace std;
int replaceStr(string& base, const string source, const string target) {
  int count = 0;
  string::size_type pos(base.find(source));
  while (pos != string::npos) {
    count++;
    base.replace(pos, source.length(), target);
    pos = base.find(source, pos + target.length());
  }
  return count;
}
int countPair(string& base) {
  int count = 0;
  string::size_type pos;
  pos = std::min(base.find("01"), base.find("10"));
  while (pos != string::npos) {
    count++;
    pos = std::min(base.find("01", pos + 2), base.find("10", pos + 2));
  }
  return count;
}
int main() {
  string S;
  cin >> S;
  cout << countPair(S) * 2 << endl;
}
