#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const long long mod = pow(10, 9) + 7;
const long long INF = pow(2, 31) - 1;
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;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long g = gcd(a, b);
  long long lc = (a / g) * b;
  return lc;
}
int main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int n = s.size();
  long long ans = 0;
  for (int i = 0; i <= (n); i++) {
    int pos = s.find("10");
    int pos2 = s.find("01");
    if (pos == string::npos && pos2 == string::npos)
      break;
    else {
      if (pos != string::npos) {
        s = s.erase(pos, 2);
        ans++;
        continue;
      }
      if (pos2 != string::npos) {
        s = s.erase(pos2, 2);
        ans++;
        continue;
      }
    }
  }
  cout << 2 * ans << endl;
  return 0;
}
