#include <bits/stdc++.h>
using namespace std;
int x[] = {-1, 0, 1, 0};
int y[] = {0, -1, 0, 1};
int xx[] = {-1, -1, 1, 1};
int yy[] = {1, -1, 1, -1};
int main() {
  string s;
  cin >> s;
  char ju = s[0];
  char jud;
  if (ju == '1') {
    jud = '0';
  } else {
    jud = '1';
  }
  int cnt = 0;
  int ans = 0;
  for (int i = 0; i < (int)(s.size()); i++) {
    if (ju == s[i]) {
      cnt++;
    } else if (cnt > 0 && jud == s[i]) {
      ans++;
      cnt--;
    }
  }
  cout << ans * 2 << endl;
}
