#include <bits/stdc++.h>
const int N = 6e6, X = 103;
char s[N];
int i, l, r, t = 1, ans, f[N];
int main() {
  for (gets(s); s[i]; i++)
    l = l * X + s[i], r += s[i] * t, t *= X,
    f[i + 1] = (l == r) ? f[(i + 1) / 2] + 1 : 0, ans += f[i + 1];
  printf("%d\n", ans);
}
