#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
struct edge {
  int to, weight;
  edge(int to, int weight) : to(to), weight(weight) {}
};
using Graph = vector<vector<int> >;
using GraphEdge = vector<vector<int> >;
long long modinv(long long a, long long m = MOD) {
  long long b = m, u = 1, v = 0;
  while (b) {
    long long t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}
int main() {
  string S;
  cin >> S;
  int N = S.length();
  queue<char> Q;
  int count = 0;
  for (int i = 0; i < N; i++) {
    if (Q.front() == '1' && S[i] == '0') {
      Q.pop();
      count += 2;
    } else if (Q.front() == '0' && S[i] == '1') {
      Q.pop();
      count += 2;
    } else {
      Q.push(S[i]);
    }
  }
  cout << count << endl;
  return 0;
}
