#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int rem = 0;
  string s;
  cin >> s;
  size_t x = s.find("01");
  while (x != string::npos) {
    s.erase(x, 2);
    rem++;
    x = s.find("01");
  }
  x = s.find("10");
  while (x != string::npos) {
    s.erase(x, 2);
    rem++;
    x = s.find("01");
  }
  cout << 2 * rem << "\n";
  return 0;
}
