#include <bits/stdc++.h>
#pragma GCC optimize("O2,Ofast,inline,unroll-all-loops,-ffast-math")
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  string s;
  cin >> s;
  int l = s.length(), ans = 0;
  vector<int> a(l);
  vector<bool> m(l, false);
  for (int i = 0; i < l; ++i) a[i] = s[i] - '0';
  bool flag = true;
  while (flag) {
    flag = false;
    for (int i = 0; i < l - 1; ++i) {
      if (m[i]) continue;
      int j = i + 1;
      while (j < l && m[j]) ++j;
      if (a[i] != a[j]) {
        m[i] = m[j] = true;
        ans += 2;
        flag = true;
      }
    }
  }
  cout << ans;
  return 0;
}
