#include <bits/stdc++.h>
using namespace std;
int next(bool *mask, int ptr) {
  int res = ptr + 1;
  while (mask[res]) {
    res++;
  }
  return res;
}
int main(void) {
  char s[100003];
  cin >> s;
  bool mask[100003];
  int n = strlen(s);
  bool flg = true;
  int cnt = 0;
  while (flg) {
    flg = false;
    int ptr = 0;
    while (true) {
      if (mask[ptr]) {
        ptr += 2;
        continue;
      }
      int nn = next(mask, ptr);
      if (nn >= n) break;
      if ((s[ptr] == '0' && s[nn] == '1') || (s[ptr] == '1' && s[nn] == '0')) {
        mask[ptr] = true;
        mask[nn] = true;
        cnt++;
        flg = true;
        ptr++;
      }
      ptr++;
    }
  }
  cout << (cnt * 2) << endl;
  return 0;
}
