#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>

using namespace std;


int main()
{
    string str, i;
    getline(cin, str);
    
    vector<int> v;
    int tmp;
    for(i=0 ; i<str.size();  i++)
    {
        tmp = str[i] - '0';
        v.push_back(tmp);
    }
    
    int len = v.size();
    int count = 0;
    int pos = 0;

    for(i=0; i<len;)
    {
        if( i < v.size()-1 )
        {
            if( (v[i]+v[i+1]) == 1 )
            {
                count+=2;
                len -= 2;
                v.erase(v.begin()+i);
                v.erase(v.begin()+i);
                i = 0;
            }
            else
            {
                i++;
            }
        }
        else
        {
            break;
        }
    }

    printf("%d", count);
    return 0;
}