#include <bits/stdc++.h>
using namespace std;
long long int MOD = 1000000007;
long long int INFL = 1ll << 60;
long long int INF = 1 << 30;
int dx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int dy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
template <typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
  cout << "{";
  for (int i = 0; i < vec.size(); i++)
    os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  cout << "}";
  return os;
}
void dump() { cout << endl; }
template <class Head, class... Tail>
void dump(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(Tail) != 0) cout << " ";
  dump(std::move(tail)...);
}
int main() {
  string s;
  cin >> s;
  int i = 0, count = 0;
  while (i < s.size()) {
    if (s.substr(i, 2) == "01" || s.substr(i, 2) == "10") {
      s.erase(s.begin() + i, s.begin() + i + 2);
      count += 2;
      if (0 < i) i -= 2;
    }
    i++;
  }
  cout << count << endl;
}
