#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int flag = 0, q = 0;
  cin >> s;
  while (flag == 0) {
    for (int i = 0; i <= s.length(); i++) {
      if ((s[i] == 0 && s[i + 1] == 1) || s[i] == 1 && s[i + 1] == 0) {
        q += 2;
        for (int j = i; j <= s.length() - 2; j++) s[i] = s[i + 2];
      } else
        flag = 1;
    }
  }
  cout << q;
  return 0;
}
