#include <bits/stdc++.h>
using namespace std;
int main() {
  char s;
  int tmp = 10 ^ 5, i = 0;
  char a[tmp];
  while (cin >> s) {
    a[i] = s;
    i++;
  }
  int N = i;
  int ans = 0;
  int count = 0;
  do {
    for (i = 0; i < N - 1; i++) {
      if (a[i] == '0' && a[i + 1] == '1' || a[i] == '1' && a[i + 1] == '0') {
        ans++;
        a[i] = a[i + 1] = 'a';
      }
    }
    count = 0;
    for (i = 0; i < N; i++) {
      if (a[i] == 'a') count++;
    }
    for (i = 0; i < N; i++) {
      if (a[i] == 'a') {
        int j;
        for (j = i; j < N; j++) {
          a[j] = a[j + 1];
        }
        N--;
      }
    }
  } while (count != 0);
  cout << 2 * ans << endl;
  return 0;
}
