#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long total = 0;
  while (1) {
    long long count = 0;
    for (long long i = 0; i < max((signed)0, (signed)s.size() - 1); i++) {
      if (s.substr(i, 2) == "01" || s.substr(i, 2) == "10") {
        s.erase(i, 2);
        i--;
        count += 2;
      }
    }
    if (count == 0)
      break;
    else
      total += count;
  }
  cout << total << endl;
  return 0;
}
