#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const int dx[4] = {0, -1, 1, 0};
const int dy[4] = {-1, 0, 0, 1};
const int INF = 1e9 + 7;
int gcd(int x, int y) {
  if (x < y) swap(x, y);
  if (y == 0) return x;
  return gcd(y, x % y);
}
template <class T1, class T2>
void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <class T1, class T2>
void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
template <class T>
void Add(T &a, const T &b, const T &mod = 1000000007) {
  int val = ((a % mod) + (b % mod)) % mod;
  if (val < 0) {
    val += mod;
  }
  a = val;
}
int ans = 0;
void def(int n) {}
int main() {
  string S;
  int count = 0;
  cin >> S;
  vector<int> V;
  for (int i = 0; i < S.size(); ++i) {
    if (S[i] == '0') {
      V.push_back(0);
    } else {
      V.push_back(1);
    }
  }
  while (true) {
    bool can = false;
    for (int i = 0; i < V.size() - 1; ++i) {
      if (V[i] != V[i + 1]) {
        can = true;
        V.erase(V.begin() + i, V.begin() + i + 2);
        count += 2;
        break;
      }
    }
    if (!can) break;
  }
  cout << count << endl;
  return 0;
}
