#include <bits/stdc++.h>
using namespace std;
struct Fast {
  Fast() {
    std::cin.tie(0);
    ios::sync_with_stdio(0);
  }
} fast;
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;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
const int inf = 1e9 + 7;
signed main(void) {
  string s;
  int cnt = 0;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if ((s[i] == '0' && s[i + 1] == '1') || (s[i] == '1' && s[i + 1] == '0')) {
      s.erase(i, 2);
      cnt += 2;
      i = 0;
    }
  }
  if ((s[0] == '0' && s[1] == '1') || (s[0] == '1' && s[1] == '0')) {
    cnt += 2;
  }
  cout << cnt << endl;
}
