#include <bits/stdc++.h>
int main() {
  std ::string Str;
  std ::cin >> Str;
  int Len = Str.size(), Ans = 0;
  std ::stack<int> Stack;
  Stack.push(Str[0] - '0');
  for (int i = 1; i < Len; i++) {
    int Now = Str[i] - '0';
    if (Stack.empty()) Stack.push(Now);
    if (Now != Stack.top()) {
      Stack.pop();
      Ans += 2;
    } else {
      Stack.push(Now);
    }
  }
  printf("%d", Ans);
  return 0;
}
