#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1001001001;
const ll INF_LL = 1001001001001001001LL;
int main(void) {
  string s;
  cin >> s;
  string er1 = "01";
  string er2 = "10";
  bool ok1 = false;
  bool ok2 = false;
  int ans = 0;
rem:
  while (s.find(er1) != string::npos) {
    int it1 = s.find(er1);
    auto L_itr1 = s.begin() + it1;
    auto R_itr1 = s.begin() + it1 + 1;
    s.erase(L_itr1, R_itr1 + 1);
    ans += 2;
  }
  ok1 = true;
  while (s.find(er2) != string::npos) {
    int it2 = s.find(er2);
    auto L_itr2 = s.begin() + it2;
    auto R_itr2 = s.begin() + it2 + 1;
    s.erase(L_itr2, R_itr2 + 1);
    ans += 2;
  }
  ok2 = true;
  if (s.find(er1) != string::npos || s.find(er2) != string::npos) goto rem;
  cout << ans << endl;
  return 0;
}
