#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  while (a && b) {
    if (a >= b)
      a %= b;
    else
      b %= a;
  }
  return a + b;
}
long long ketasum(long long n) {
  long long sum = 0;
  if (n < 0) return 0;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
bool comp(const pair<long long, long long> &a,
          const pair<long long, long long> &b) {
  return a.first < b.first;
}
void sort2vectors(vector<long long> &av, vector<long long> &bv) {
  long long n = av.size();
  vector<pair<long long, long long> > p(n);
  vector<long long> av2(n), bv2(n);
  for (long long i = 0; i < n; i++) p[i] = make_pair(av[i], bv[i]);
  sort(p.begin(), p.end(), comp);
  for (long long i = 0; i < n; i++) {
    av2[i] = p[i].first;
    bv2[i] = p[i].second;
  }
  av = av2;
  bv = bv2;
}
long long facctorialMethod(long long k) {
  long long s;
  if (k > 1) {
    s = k * facctorialMethod(k - 1);
  } else {
    s = 1;
  }
  return s;
}
map<int64_t, long long> prime_factor(int64_t n) {
  map<int64_t, long long> ret;
  for (int64_t i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1) ret[n] = 1;
  return ret;
}
template <class T>
int LIS(vector<T> a, bool is_strong = true) {
  const T INF = 1 << 30;
  int n = (int)a.size();
  vector<T> dp(n, INF);
  for (int i = 0; i < n; ++i) {
    if (is_strong)
      *lower_bound(dp.begin(), dp.end(), a[i]) = a[i];
    else
      *upper_bound(dp.begin(), dp.end(), a[i]) = a[i];
  }
  return lower_bound(dp.begin(), dp.end(), INF) - dp.begin();
}
long long modpow(long long a, long long n, long long mod) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
void foreach_permutation(long long n, std::function<void(long long *)> f) {
  long long indexes[n];
  for (long long i = 0; i < n; i++) indexes[i] = i;
  do {
    f(indexes);
  } while (std::next_permutation(indexes, indexes + n));
}
long double dist(long long x, long long y, long long x2, long long y2) {
  return sqrt((x - x2) * (x - x2) + (y - y2) * (y - y2));
}
long long GetDigit(long long num) {
  long long digit = 0;
  while (num != 0) {
    num /= 10;
    digit++;
  }
  return digit;
}
const long long MOD = 1000000007;
const long long INF = 1e15;
const int MAX = 10000000;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}
long long COM(int n, int k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
template <class MeetSemiLattice>
struct SparseTable {
  vector<vector<MeetSemiLattice> > dat;
  vector<int> height;
  SparseTable() {}
  SparseTable(const vector<MeetSemiLattice> &vec) { init(vec); }
  void init(const vector<MeetSemiLattice> &vec) {
    int n = (int)vec.size(), h = 0;
    while ((1 << h) < n) ++h;
    dat.assign(h, vector<MeetSemiLattice>(1 << h));
    height.assign(n + 1, 0);
    for (int i = 2; i <= n; i++) height[i] = height[i >> 1] + 1;
    for (int i = 0; i < n; ++i) dat[0][i] = vec[i];
    for (int i = 1; i < h; ++i)
      for (int j = 0; j < n; ++j)
        dat[i][j] =
            min(dat[i - 1][j], dat[i - 1][min(j + (1 << (i - 1)), n - 1)]);
  }
  MeetSemiLattice get(int a, int b) {
    return min(dat[height[b - a]][a],
               dat[height[b - a]][b - (1 << height[b - a])]);
  }
};
struct SuffixArray {
  string str;
  vector<int> sa;
  vector<int> lcp;
  inline int &operator[](int i) { return sa[i]; }
  SuffixArray(const string &str_) : str(str_) {
    buildSA();
    calcLCP();
  }
  void init(const string &str_) {
    str = str_;
    buildSA();
    calcLCP();
  }
  vector<int> rank_sa, tmp_rank_sa;
  struct CompareSA {
    int n, k;
    const vector<int> &rank;
    CompareSA(int n, int k, const vector<int> &rank_sa)
        : n(n), k(k), rank(rank_sa) {}
    bool operator()(int i, int j) {
      if (rank[i] != rank[j])
        return (rank[i] < rank[j]);
      else {
        int rank_ik = (i + k <= n ? rank[i + k] : -1);
        int rank_jk = (j + k <= n ? rank[j + k] : -1);
        return (rank_ik < rank_jk);
      }
    }
  };
  void buildSA() {
    int n = (int)str.size();
    sa.resize(n + 1), lcp.resize(n + 1), rank_sa.resize(n + 1),
        tmp_rank_sa.resize(n + 1);
    for (int i = 0; i < n; ++i) sa[i] = i, rank_sa[i] = (int)str[i];
    sa[n] = n, rank_sa[n] = -1;
    for (int k = 1; k <= n; k *= 2) {
      CompareSA csa(n, k, rank_sa);
      sort(sa.begin(), sa.end(), csa);
      tmp_rank_sa[sa[0]] = 0;
      for (int i = 1; i <= n; ++i) {
        tmp_rank_sa[sa[i]] = tmp_rank_sa[sa[i - 1]];
        if (csa(sa[i - 1], sa[i])) ++tmp_rank_sa[sa[i]];
      }
      for (int i = 0; i <= n; ++i) rank_sa[i] = tmp_rank_sa[i];
    }
  }
  vector<int> rsa;
  SparseTable<int> st;
  void calcLCP() {
    int n = (int)str.size();
    rsa.resize(n + 1);
    for (int i = 0; i <= n; ++i) rsa[sa[i]] = i;
    lcp.resize(n + 1);
    lcp[0] = 0;
    int cur = 0;
    for (int i = 0; i < n; ++i) {
      int pi = sa[rsa[i] - 1];
      if (cur > 0) --cur;
      for (; pi + cur < n && i + cur < n; ++cur) {
        if (str[pi + cur] != str[i + cur]) break;
      }
      lcp[rsa[i] - 1] = cur;
    }
    st.init(lcp);
  }
  int getLCP(int a, int b) {
    return st.get(min(rsa[a], rsa[b]), max(rsa[a], rsa[b]));
  }
};
template <unsigned mod>
struct RollingHash {
  vector<unsigned> hashed, power;
  inline unsigned mul(unsigned a, unsigned b) const {
    unsigned long long x = (unsigned long long)a * b;
    unsigned xh = (unsigned)(x >> 32), xl = (unsigned)x, d, m;
    asm("divl %4; \n\t" : "=a"(d), "=d"(m) : "d"(xh), "a"(xl), "r"(mod));
    return m;
  }
  RollingHash(const string &s, unsigned base = 10007) {
    int sz = (int)s.size();
    hashed.assign(sz + 1, 0);
    power.assign(sz + 1, 0);
    power[0] = 1;
    for (int i = 0; i < sz; i++) {
      power[i + 1] = mul(power[i], base);
      hashed[i + 1] = mul(hashed[i], base) + s[i];
      if (hashed[i + 1] >= mod) hashed[i + 1] -= mod;
    }
  }
  unsigned get(int l, int r) const {
    unsigned ret = hashed[r] + mod - mul(hashed[l], power[r - l]);
    if (ret >= mod) ret -= mod;
    return ret;
  }
  unsigned connect(unsigned h1, int h2, int h2len) const {
    unsigned ret = mul(h1, power[h2len]) + h2;
    if (ret >= mod) ret -= mod;
    return ret;
  }
  int LCP(const RollingHash<mod> &b, int l1, int r1, int l2, int r2) {
    int len = min(r1 - l1, r2 - l2);
    int low = -1, high = len + 1;
    while (high - low > 1) {
      int mid = (low + high) / 2;
      if (get(l1, l1 + mid) == b.get(l2, l2 + mid))
        low = mid;
      else
        high = mid;
    }
    return (low);
  }
};
using RH = RollingHash<1000000007>;
void UFinit(long long n);
long long UFfind(long long x);
void UFunite(long long x, long long y);
bool UFsame(long long x, long long y);
long long MAX_N;
const double PI = 3.14159265358979;
string S;
void solve() {
  cin >> S;
  long long ans = 0;
  for (long long i = 0; i < S.size() - 1 && S.size() != 0; i++) {
    if (S.substr(i, 1) == "0" && S.substr(i + 1, 1) == "1") {
      ans += 2;
      S.erase(i, 2);
      i = -1;
    } else if (S.substr(i, 1) == "1" && S.substr(i + 1, 1) == "0") {
      ans += 2;
      S.erase(i, 2);
      i = -1;
    }
  }
  cout << ans << endl;
}
vector<long long> UFpar(MAX_N);
vector<long long> UFrank(MAX_N);
void UFinit(long long n) {
  for (long long i = (0); i < (n); i++) {
    UFpar[i] = i;
    UFrank[i] = 0;
  }
}
long long UFfind(long long x) {
  if (UFpar[x] == x) {
    return x;
  } else {
    return UFpar[x] = UFfind(UFpar[x]);
  }
}
void UFunite(long long x, long long y) {
  x = UFfind(x);
  y = UFfind(y);
  if (x == y) {
    return;
  }
  if (UFrank[x] < UFrank[y]) {
    UFpar[x] = y;
  } else {
    UFpar[y] = x;
    if (UFrank[x] == UFrank[y]) {
      UFrank[x]++;
    }
  }
}
bool UFsame(long long x, long long y) { return UFfind(x) == UFfind(y); }
int main() {
  cout << std::fixed << std::setprecision(20);
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
}
