#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  cin >> a;
  int count = 0;
  vector<char> b(a.size());
  if (a.size() == 1)
    cout << 0 << endl;
  else {
    for (int i = 0; i < a.size(); i++) {
      b.at(i) = a.at(i);
    }
    bool check = true;
    while (check == true) {
      for (int i = 0; i < a.size() - 1; i++) {
        if ((b.at(i) == '1' && b.at(i + 1) == '0') ||
            (b.at(i) == '0' && b.at(i + 1) == '1')) {
          b.at(i) = '2';
          b.at(i + 1) = '2';
          count++;
          for (int j = 0; j < a.size() - i - 2; j++) {
            swap(b.at(i + 1 + j), b.at(i + 2 + j));
            swap(b.at(i + j), b.at(i + 1 + j));
          }
          break;
        } else if (i == a.size() - 2)
          check = false;
      }
    }
    cout << 2 * count << endl;
  }
}
