#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool has_key(unordered_map<string, ll> &m, string s) {
  if (m.find(s) == m.end()) {
    return false;
  } else {
    return true;
  }
}
bool vector_find(std::vector<ll> vec, ll number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance(vec.begin(), itr);
  if (index != vec.size()) {
    return true;
  } else {
    return false;
  }
}
void recursive_comb(int *indexes, int s, int rest,
                    std::function<void(int *)> f) {
  if (rest == 0) {
    f(indexes);
  } else {
    if (s < 0) return;
    recursive_comb(indexes, s - 1, rest, f);
    indexes[rest - 1] = s;
    recursive_comb(indexes, s - 1, rest - 1, f);
  }
}
void foreach_comb(int n, int k, std::function<void(int *)> f) {
  int indexes[k];
  recursive_comb(indexes, n - 1, k, f);
}
int main() {
  string S;
  cin >> S;
  ll del_num = 0;
  ll del_num_prev = 0;
  while (1) {
    for (ll i = 0; i < S.size() - 1; i++) {
      if (S.substr(i, 2) == "01" || S.substr(i, 2) == "10") {
        S = S.substr(0, i) + S.substr(i + 2, S.size() - (i + 2));
        del_num += 2;
        break;
      }
    }
    if (del_num == del_num_prev || S.size() == 0) break;
    del_num_prev = del_num;
  }
  cout << del_num << endl;
  return 0;
}
