#include <bits/stdc++.h>
int main() {
  char c;
  int ans = 0;
  std::stack<int> s;
  s.push(-1);
  while ((c = getc(stdin)) != EOF) {
    if (s.top() != -1 && s.top() != c - '0') {
      s.pop();
      ans += 2;
      continue;
    }
    s.push(c - '0');
  }
  printf("%d\n", ans);
}
