#include <bits/stdc++.h>
int main() {
  std::string s;
  std::cin >> s;
  const std::string pattern_1("01");
  const std::string pattern_2("10");
  std::string::size_type pos_1 = s.find(pattern_1);
  std::string::size_type pos_2 = s.find(pattern_2);
  unsigned int counter = 0;
  while (pos_1 != -1 || pos_2 != -1) {
    if (pos_1 != -1) {
      s.erase(s.begin() + pos_1, s.begin() + pos_1 + 2);
    } else {
      s.erase(s.begin() + pos_2, s.begin() + pos_2 + 2);
    }
    pos_1 = s.find(pattern_1);
    pos_2 = s.find(pattern_2);
    counter++;
  }
  std::cout << counter * 2 << std::endl;
  return 0;
}
