#include <bits/stdc++.h>
using namespace std;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
const int ddy[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
const int inf = 99999999;
const long long linf = 1LL << 62;
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  if (a % b == 0)
    return b;
  else
    gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  if (a < b) swap(a, b);
  return (a / gcd(a, b)) * b;
}
struct UnionFind {
  vector<int> par;
  UnionFind(int N) : par(N) {
    for (int i = 0; i < N; i++) par[i] = i;
  }
  int root(int x) {
    if (par[x] == x) return x;
    return par[x] = root(par[x]);
  }
  void unite(int x, int y) {
    int rx = root(x);
    int ry = root(y);
    if (rx == ry) return;
    par[rx] = ry;
  }
  bool same(int x, int y) {
    int rx = root(x);
    int ry = root(y);
    return rx == ry;
  }
};
int main() {
  string S;
  cin >> S;
  int ans = S.length();
  bool flag = true;
  while (flag) {
    int pos = S.find("01");
    if (pos == -1) {
      pos = S.find("10");
    }
    if (pos == -1) break;
    S.erase(pos, 2);
  }
  cout << ans - S.length() << endl;
  return 0;
}
