#include <bits/stdc++.h>
using namespace std;
int f(string S) {
  static int ans = 0;
  static int two = 0;
  for (int i = 0; i < S.length(); i++) {
    if (i != S.length() - 1 && S[i] == '0' && S[i + 1] == '1') {
      two = 0;
      ans += 2;
      S.erase(S.begin() + i);
      S.erase(S.begin() + i + 1);
    }
    if (i != S.length() - 1 && S[i] == '1' && S[i + 1] == '0') {
      two = 0;
      ans += 2;
      S.erase(S.begin() + i);
      S.erase(S.begin() + i - 1);
    }
  }
  two++;
  if (two != 2) f(S);
  return ans;
}
int main() {
  string S;
  cin >> S;
  cout << f(S);
  return 0;
}
