#include <bits/stdc++.h>
using namespace std;
int next(vector<int> &v, int i) {
  for (; i < v.size(); i++) {
    if (-1 != v[i]) return i;
  }
  return -1;
}
int main() {
  string S;
  cin >> S;
  vector<int> v;
  int count = 0;
  for (auto ch : S) v.push_back(ch - '0');
  while (true) {
    bool flg = true;
    for (int i = 0; i < v.size() - 1; i++) {
      int n = next(v, i + 1);
      if (-1 == n) {
        i++;
        continue;
      }
      if ((0 == v[i] && 1 == v[n]) || (1 == v[i] && 0 == v[n])) {
        v[i] = v[n] = -1;
        count += 2;
        flg = false;
      }
    }
    if (flg) break;
  }
  cout << count << endl;
}
