#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int cnt = 0;
  cin >> s;
  while (1) {
    if (s.find("01") == -1 && s.find("10") == -1) break;
    if (s.find("01") != -1) {
      cnt++;
      s.erase(s.find("01"), 2);
    }
    if (s.find("10") != -1) {
      cnt++;
      s.erase(s.find("10"), 2);
    }
  }
  cout << cnt * 2 << endl;
}
