#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000001;
const float PI = 3.14;
const int mod = 1e9 + 7;
typedef map<string, int> msi;
typedef vector<pair<int, int> > vii;
typedef priority_queue<pair<int, int>, vector<pair<int, int> >,
                       greater<pair<int, int> > >
    pq;
vector<pair<int, int> >::iterator iter;
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  vector<char> V;
  V.push_back('#');
  int n = s.size();
  for (int i = 0; i < s.size(); i++) {
    V.push_back(s[i]);
  }
  V.push_back('#');
  vector<char>::iterator it;
  vector<char>::iterator it2;
  int licznik = 0;
  int i = 0;
  while (i != V.back()) {
    if ((V[i] == '0' && V[i + 1] == '1') || (V[i] == '1' && V[i + 1] == '0')) {
      it = V.begin() + i;
      licznik += 2;
      V.erase(it, it + 2);
      i = -1;
    }
    i++;
  }
  cout << licznik << endl;
  return 0;
}
