#include <bits/stdc++.h>
using namespace std;
struct Info {
  long long A, B;
};
bool operator<(const Info &left, const Info &right) { return left.A < right.A; }
unsigned long long XOR(unsigned long long A, unsigned long long B) {
  return A ^ B;
}
int f(char *buf, int N, int l, int u) {
  while (buf[l] == 'x') {
    l--;
    if (l < 0) {
      return 0;
    }
  }
  while (buf[u] == 'x') {
    u++;
    if (u >= N) {
      return 0;
    }
  }
  if (buf[l] == buf[u]) {
    buf[l] = buf[u] = 'x';
    return 2 + f(buf, N, l - 1, u + 1);
  }
  return 0;
}
int main() {
  char S[100000];
  scanf("%s", S);
  int L = strlen(S);
  int count = 0;
  for (int i = (int)(0); i < (int)(L - 1); i++) {
    count += f(S, L, i, i + 1);
    while (S[i + 1] == 'x') {
      i++;
      if (i >= L) {
        cout << count << endl;
      }
    }
  }
  cout << count << endl;
  return 0;
}
