#include <cstdio>
#include <iostream>
#include <string>
using namespace std;

int main(){
    string s;
    bool flag0, flag1;
    int cnt;
    cnt = 0;
    flag0 = 0;
    flag1 = 0;
    scanf("%s\n", s);
    for(int i = 0; i < s.length(); i++){
        if(s[i] == 0) flag0 = 1;
        else if(s[i] == 1) flag1 = 1;
    }
    if(flag0 == 0 || flag1 == 0) printf(0);
    else {
        for(size_t c = s.find_first_of("10"); c != string::npos; c = c = s.find_first_of("10")){
            s.erase(c,1);
            cnt += 2;
        }
        for(size_t c = s.find_first_of("01"); c != string::npos; c = c = s.find_first_of("01")){
            s.erase(c,1);
            cnt += 2;
        }
        printf("%d\n", cnt);
    }
    return 0;
}