#include <bits/stdc++.h>
using namespace std;
char a[101000];
int main() {
  int cnt = 0;
  scanf("%s", a);
  for (int i = 0; a[i]; i++) {
    if ((a[i] == '0' && a[i + 1] == '1') || (a[i] == '1' && a[i + 1] == '0')) {
      cnt += 2;
      for (int j = i + 2; a[j]; j++) a[j - 2] = a[j];
      i -= 2;
    }
  }
  cout << cnt;
  return 0;
}
