#include <bits/stdc++.h>
char s[5005000];
int h[5005000];
const int M = 1239;
int main() {
  scanf("%s", s);
  int a = 0, b = 0, p = 1, v = 0;
  for (int i = 0; s[i]; ++i) {
    a = a * M + s[i], b += s[i] * p, p *= M;
    if (a == b) v += (h[i + 1] = h[(i + 1) >> 1] + 1);
  }
  printf("%d\n", v);
  return 0;
}
