#include <bits/stdc++.h>
using namespace std;
const int MaxN = 5000009;
char s[MaxN], t[MaxN];
int p[MaxN], q[MaxN], r[MaxN], z[MaxN];
int n;
int main(void) {
  int i, j, k, res;
  while (scanf(" %s", s + 1) != EOF) {
    s[0] = t[0] = '\0';
    n = strlen(s + 1);
    for (i = 1; i <= n; i++) t[n - i + 1] = s[i];
    t[n + 1] = '\xFF';
    k = -1;
    p[0] = k;
    for (i = 1; i <= n; i++) {
      while (k >= 0 && s[k + 1] != s[i]) k = p[k];
      k++;
      p[i] = k;
    }
    k = 0;
    q[0] = k;
    for (i = 1; i <= n; i++) {
      while (k >= 0 && s[k + 1] != t[i]) k = p[k];
      k++;
      q[i] = k;
    }
    memset(z, 0, sizeof(z));
    k = 0;
    i = 1;
    while (i <= n) {
      if (k == -1) k++;
      while (t[i + k] == s[k + 1]) k++;
      z[i] = k;
      i += k - p[k];
      k = p[k];
    }
    memset(r, 0, sizeof(r));
    res = 0;
    k = 0;
    for (i = 1; i <= n; i++) {
      j = i >> 1;
      if (z[n - i + 1] >= j) r[i] = 1 + r[j];
    }
    for (i = 1; i <= n; i++) res += r[i];
    printf("%d\n", res);
  }
  return 0;
}
