#include <bits/stdc++.h>
using namespace std;

int main() {
	string s;
	cin >> s;
	vector<bool> a;
	for (int i = 0; i < (int) s.size(); i++) {
		a.emplace_back(s[i] - '0');
	}

	int count = 0;
	for (auto i = a.begin(); i + 1 < a.end();) {
		if (*i ^ *(i + 1)) {
			a.erase(i, i + 2);
			count++;
			if (i != a.begin())
				i--;
		} else {
			i++;
		}
	}
	cout << count * 2 << endl;
}
