#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000");
using namespace std;
const int MAXN = 5000010;
char s[MAXN];
unsigned long long e = 256;
unsigned long long pre[MAXN], suf[MAXN];
unsigned long long p1[MAXN], s1[MAXN];
long long K[MAXN];
int main() {
  scanf("%s", s + 1);
  int i, n = strlen(s + 1);
  for (i = 1, pre[0] = 0; i <= n; ++i) pre[i] = pre[i - 1] * e + s[i];
  for (i = 2, suf[1] = s[1]; i <= n; ++i)
    suf[i] = suf[i - 1] + s[i] * e, e *= 256;
  e = 256;
  for (i = 1, p1[0] = 0; i <= n; ++i) {
    p1[i] = p1[i - 1] * e + s[i];
    p1[i] %= 1000000007;
  }
  for (i = 2, s1[1] = s[1]; i <= n; ++i) {
    s1[i] = s1[i - 1] + s[i] * e, e *= 256;
    e %= 1000000007, s1[i] %= 1000000007;
  }
  K[0] = 0;
  for (K[0] = 0, i = 1; i <= n; ++i) {
    if (pre[i] == suf[i] && p1[i] == s1[i])
      K[i] = K[i / 2] + 1;
    else
      K[i] = 0;
  }
  long long ans = 0;
  for (i = 1; i <= n; ++i) ans += K[i];
  printf("%I64d\n", ans);
  return 0;
}
