#include <bits/stdc++.h>
using namespace std;
const double PI = 2 * acos(0.0);
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string s;
  cin >> s;
  int cnt = 0;
  while (s.find("01") != string::npos || s.find("10") != string::npos) {
    int idx = 0;
    if (s.find("01") != string::npos)
      idx = s.find("01");
    else
      idx = s.find("10");
    s.erase(idx, 2);
    cnt += 2;
  }
  cout << cnt << '\n';
}
