#include <algorithm>
#include <cstdio>
#include <string>
#include <vector>
using namespace std;

int main(){
    string s;
    scanf("%s", s);
    int originalSize = s.size();
    bool trimmed = false;

    while(true){
        trimmed = false;
        for(int i = 0; i < s.size(); i++){
            if (s[i] == '0' && s[i+1] == '1') {
                s.erase(i, 2);
                trimmed = true;
                break;
            }
            else if (s[i] == '1' && s[i+1] == '0') {
                s.erase(i, 2);
                trimmed = true;
                break;
            }
        }
        if (!trimmed) {
            break;
        }
        
    }

    int finalSize = s.size();
    printf("%d", originalSize - finalSize);
    printf("\n");
}