#include <bits/stdc++.h>
const int64_t modulo = 1000000000000037LL, base = 128;
int64_t prefix, suffix, multi = 1, answer = 1;
int d[5 * 1000001];
char line[5 * 1000001];
int main() {
  char *c;
  int i;
  scanf("%s", line);
  for (c = line, i = 0, d[0] = 1; *c; ++c, ++i) {
    prefix = ((prefix * base) % modulo + line[i]) % modulo;
    suffix = ((multi * line[i]) % modulo + suffix) % modulo;
    multi = (multi * base) % modulo;
    int prev = (i + 1) / 2 - 1;
    if (i && prefix == suffix) {
      d[i] = 1 + d[prev];
      answer += d[i];
    }
  }
  printf("%lld\n", answer);
  return 0;
}
