#include <bits/stdc++.h>
using namespace std;
string v;
int main() {
  long long n, x, y;
  cin >> v;
  x = 0, y = 0;
  for (int i = 0; i < v.size() - 1; i++) {
    if (v[i] == '0')
      x++;
    else
      y++;
  }
  x *= 2;
  y *= 2;
  cout << min(x, y) << endl;
}
