#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0;
  string s;
  cin >> s;
  n = s.size();
  for (int i = 0; i < n;) {
    if (s[i] == '1' && s[i + 1] == '0' || s[i] == '0' && s[i + 1] == '1') {
      for (int j = i; j < n - 2; j++) {
        int l = j + 2;
        s[j] = s[l];
      }
      n -= 2;
      i = 0;
      sum += 2;
      continue;
    }
    i++;
  }
  printf("%d\n", sum);
  return 0;
}
