#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; }
int main() {
  string S;
  cin >> S;
  int count = 0;
  string S2 = S;
  while (S.find("01") != string::npos) {
    int place = S.find("01");
    S.erase(place, 2);
    count += 2;
  }
  while (S.find("10") != string::npos) {
    int place = S.find("10");
    S.erase(place, 2);
    count += 2;
  }
  int count2 = 0;
  while (S2.find("10") != string::npos) {
    int place = S2.find("10");
    S2.erase(place, 2);
    count2 += 2;
  }
  while (S.find("01") != string::npos) {
    int place = S2.find("01");
    S2.erase(place, 2);
    count2 += 2;
  }
  cout << max(count, count2) << endl;
}
