#include <bits/stdc++.h>
const int fin = 0, maxn = 10000020;
int n;
char a[maxn];
int p[maxn], f[maxn];
bool b[maxn];
int main() {
  int m, ans, i, j;
  char ch;
  n = 0;
  while (scanf("%c", &ch) == 1) a[++n] = ch;
  for (i = 1; i <= n; ++i) a[2 * n - i + 2] = a[i];
  a[n + 1] = 1;
  m = 2 * n + 1;
  j = 0;
  p[1] = 0;
  for (i = 2; i <= m; ++i) {
    while (j && a[j + 1] != a[i]) j = p[j];
    if (a[j + 1] == a[i]) ++j;
    p[i] = j;
  }
  for (i = p[m]; i; i = p[i]) b[i] = true;
  ans = 0;
  for (i = 1; i <= n; ++i) {
    if (b[i]) f[i] = f[i / 2] + 1;
    ans += f[i];
  }
  printf("%d\n", ans);
  return 0;
}
