#include <bits/stdc++.h>
using namespace std;
const long long inf = 2e9 + 7;
const int MAX_N = 5e5 + 5;
int dx[] = {-1, 0, 1, 0}, dy[] = {0, 1, 0, -1};
vector<long long> prime;
long long inv[MAX_N], fac[MAX_N];
template <class T = int>
T in() {
  T x;
  cin >> x;
  return (x);
}
inline long long GCD(long long a, long long b) {
  long long c;
  while (b != 0) {
    c = a % b;
    a = b;
    b = c;
  }
  return a;
}
inline long long LCM(long long a, long long b) { return a * b / GCD(a, b); }
inline long long POW(long long a, long long b) {
  long long c = 1;
  while (b > 0) {
    if (b & 1) {
      c = a * c % inf;
    }
    a = a * a % inf;
    b >>= 1;
  }
  return c;
}
inline void _nCr() {
  fac[0] = 1;
  for (int i = 1; i < MAX_N; i++) {
    fac[i] = fac[i - 1] * i % inf;
  }
  for (int i = 0; i < MAX_N; i++) {
    inv[i] = POW(fac[i], inf - 2);
  }
}
inline long long nCr(long long n, long long r) {
  return (fac[n] * inv[r] % inf) * inv[n - r] % inf;
}
inline void PRI(long long n) {
  bool a[n + 1];
  for (int i = 0; i < n + 1; i++) {
    a[i] = 1;
  }
  for (int i = 2; i < n + 1; i++) {
    if (a[i]) {
      prime.push_back(i);
      long long b = i;
      while (b <= n) {
        a[b] = 0;
        b += i;
      }
    }
  }
}
class UnionFind {
 private:
  int par[MAX_N];
  int rank[MAX_N];

 public:
  void init(int n);
  int find(int x);
  void unite(int x, int y);
  bool same(int x, int y);
};
void UnionFind::init(int n) {
  for (int i = 0; i < n; i++) {
    par[i] = i;
    rank[i] = 0;
  }
}
int UnionFind::find(int x) {
  if (par[x] == x)
    return x;
  else
    return par[x] = find(par[x]);
}
void UnionFind::unite(int x, int y) {
  x = find(x);
  y = find(y);
  if (rank[x] < rank[y])
    par[x] = y;
  else {
    par[y] = x;
    if (rank[x] == rank[y]) rank[x]++;
  }
}
bool UnionFind::same(int x, int y) {
  x = find(x);
  y = find(y);
  return x == y;
}
int main() {
  string s;
  cin >> s;
  int hira = 0;
  int hirahira = 0;
  int ans = 0;
  int ansans = 0;
  for (int(i) = (0); (i) < (s.size()); (i)++) {
    if (s[i] == '0') {
      hira++;
    } else {
      if (hira) {
        hira--;
        ans++;
      }
    }
    if (s[i] == '1') {
      hirahira++;
    } else {
      if (hirahira) {
        hirahira--;
        ansans++;
      }
    }
  }
  cout << max(ans, ansans) * 2 << endl;
}
