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

string s;
int count=0;

int main(){
	cin >> s;
	cout << s.length();
	
	while(s.length()>=0){
		for(int i=0; i<s.length()-1; ++i){
			if(s[i]=='0' && s[i+1]=='1'){
				s.erase(s[i],s[i+1]);
				count += 2;
			}else if(s[i]=='1' && s[i+1]=='0'){
				s.erase(s[i],s[i+1]);
				count += 2;
			}
		}
	}
	
	cout << count;
	
	return 0;

}