#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string s;
  cin >> s;
  long long zero = 0;
  long long ans = 0;
  for (char c : s) {
    if (c == '0') {
      zero++;
    } else {
      if (zero > 0) {
        zero--;
        ans += 2;
      }
    }
  }
  long long one = 0;
  long long anst = 0;
  for (char c : s) {
    if (c == '1') {
      one++;
    } else {
      if (one > 0) {
        one--;
        anst += 2;
      }
    }
  }
  cout << max(ans, anst) << endl;
}
