#include "bits/stdc++.h"

using namespace std;

void solve()
{
	string S;
	cin >> S;
	int l = S.size(), z = 0;
	for (char c : S)
	{
		z += c == '0';
	}
	z = min(z, l-z);
	cout << l - z * 2 << endl;s
}

int main(void)
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}
