#include <bits/stdc++.h>
using namespace std;
int howmany(char* s, int n) {
  int i, j, count = 0;
  for (i = 0; i < n - 1; i++) {
    if ((s[i] == '0' && s[i + 1] == '1') || (s[i] == '1' && s[i + 1] == '0')) {
      count++;
      if (i == n - 2) {
        i = -1;
        n = n - 2;
        continue;
      } else {
        for (j = i; j < n - 2; j++) {
          s[j] = s[j + 2];
        }
        n = n - 2;
        i = -1;
      }
    }
  }
  return count * 2;
}
int main() {
  char s[500];
  cin >> s;
  int n = sizeof(s) - 1;
  cout << howmany(s, n) << endl;
  return 0;
}
