#include <bits/stdc++.h>
using namespace std;
unsigned long long fac, fro, bac;
int n, dp[5000005], ans;
char c[5000005];
int main() {
  scanf("%s", c), n = strlen(c), fac = 1;
  for (register int i = 0; i < n; ++i) {
    fro = fro * 13 + c[i], bac = bac + fac * c[i], fac = fac * 13;
    if (!(fro ^ bac)) dp[i] = dp[i - 1 >> 1] + 1, ans += dp[i];
  }
  printf("%d", ans);
}
