#include <bits/stdc++.h>
using namespace std;
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;
}
template <class T>
using V = vector<T>;
const int INF = 1e9;
const int MOD = 1000000007;
using Graph = vector<vector<int>>;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  map<char, int> mp;
  for (int i = 0; i < s.size(); ++i) mp[s[i]]++;
  string tmp;
  int cnt = 0;
  while (mp['0'] > 0 && mp['1'] > 0) {
    int i = 0;
    while (i < s.size() - 1) {
      if (abs((s[i] - '0') - (s[i + 1] - '0')) == 1) {
        cnt++;
        mp['0']--;
        mp['1']--;
        if (i + 2 >= s.size() - 1) {
          tmp += s[i + 2];
          break;
        } else {
          i += 2;
        }
      } else {
        tmp += s[i];
        i++;
      }
    }
    s = tmp;
  }
  cout << cnt * 2 << "\n";
}
