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

int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());

    string S;
    cin >> S;

    bool has01 = true;
    long cnt = 0;
    while(has01) {
        has01 = false;
        for (long i = 0; i < S.length()-1; i++) {
            if (S.length > 1 && S[i] != S[i+1]) {
                S.erase(S.begin() + i + 1);
                S.erase(S.begin() + i);
                cnt += 2;
                has01 = true;
                break;
            }

        }
    }
    cout << cnt << endl;

}
