#include <bits/stdc++.h>
using namespace std;
int main(void) {
  char str[100005];
  cin >> str;
  int N = strlen(str);
  int count1 = 0;
  int count0 = 0;
  for (int i = 0; i < N; i++) {
    if (str[i] == 0) {
      count1++;
    } else {
      count0++;
    }
  }
  int gap = abs(count1 - count0);
  cout << N - gap;
  return 0;
}
