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