#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
#define fr(i,n) for(int i=0;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)

//const int INF = INT_MAX / 2;



int main() {
	string S;
	cin >> S;
	int counter = 0;
	for (int i = 0; i < S.length(); i++) {
		if (S[i] == '1') counter++;
	}
	int s = S.length();
	cout << abs(s - counter) << endl;
	return 0;
}