#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = pow(10, 18) + 1;
template <typename T>
bool chmin(T& a, T b) {
  return a > b ? a = b, true : false;
}
template <typename T>
bool chmax(T& a, T b) {
  return a < b ? a = b, true : false;
}
int main() {
  string S;
  cin >> S;
  int count = 0;
  while (true) {
    int N = S.length();
    if (N == 0 || N == 1) break;
    bool flag = false;
    for (int i = (int)(0); i < (int)(N - 1); ++i) {
      if ((S[i] == '0' && S[i + 1] == '1') ||
          (S[i] == '1' && S[i + 1] == '0')) {
        if (N - i - 2 > 0)
          S = S.substr(0, i) + S.substr(i + 2, N - i - 2);
        else
          S = S.substr(0, i);
        count += 2;
        flag = true;
        break;
      }
    }
    if (flag == false) break;
  }
  cout << count << endl;
  return 0;
}
