#include <bits/stdc++.h>
using namespace std;
long long dx[4] = {0, 0, 1, -1};
long long dy[4] = {1, -1, 0, 0};
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(12) << fixed;
}
void solve() {
  string s;
  cin >> s;
  long long n = s.size(), cnt = 0, t1 = 0, t2 = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '0')
      cnt++;
    else if (cnt > 0)
      cnt--, t1++;
  }
  cnt = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '1')
      cnt++;
    else if (cnt > 0)
      cnt--, t2++;
  }
  cout << max(t1 * 2, t2 * 2);
}
int main() {
  fast();
  long long t = 1;
  while (t--) {
    solve();
  }
}
