#include <bits/stdc++.h>
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
using uif = uint_fast64_t;
using ll = long long int;
int qp(int a, ll b) {
  int ans = 1;
  do {
    if (b & 1) ans = 1ll * ans * a % 1000000007;
    a = 1ll * a * a % 1000000007;
  } while (b >>= 1);
  return ans;
}
int qp(int a, ll b, int mo) {
  int ans = 1;
  do {
    if (b & 1) ans = 1ll * ans * a % mo;
    a = 1ll * a * a % mo;
  } while (b >>= 1);
  return ans;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main(void) {
  string s;
  cin >> s;
  ll cur_po = 0;
  ll n = s.size();
  vector<ll> cnt_0(n, 0);
  vector<ll> cnt_1(n, 0);
  for (int i = 0; i < (int)(n); i++) {
    if (i == 0) {
      if (s[i] == '0')
        cnt_0[0] = 1;
      else
        cnt_0[1] = 1;
      continue;
    }
    if (s[i] == '0') {
      cnt_0[i] = cnt_0[i - 1] + 1;
      cnt_1[i] = cnt_1[i - 1];
    } else {
      cnt_0[i] = cnt_0[i - 1];
      cnt_1[i] = cnt_1[i - 1] + 1;
    }
  }
  cout << min(cnt_0[n - 1], cnt_1[n - 1]) * 2 << endl;
  return 0;
}
