#include <bits/stdc++.h>
using namespace std;
const unsigned long long BASE = 1e9 + 7;
const int MAXN = 5000005;
char s[MAXN];
int N;
unsigned long long fhash[MAXN], bhash[MAXN], pows[MAXN];
int dp[MAXN];
bool ispal(int l, int r) {
  return (fhash[r] - fhash[l - 1]) * pows[l - 1] ==
         (bhash[r] - bhash[l - 1]) * pows[N - r];
}
int main(int argc, char *argv[]) {
  scanf("%s", s);
  pows[0] = 1;
  for (int i = 1; i < MAXN; i++) pows[i] = pows[i - 1] * BASE;
  N = strlen(s);
  for (int i = 0, _i = N; i < _i; ++i) {
    fhash[i + 1] = fhash[i] + (unsigned long long)s[i] * pows[N - i - 1];
    bhash[i + 1] = bhash[i] + (unsigned long long)s[i] * pows[i];
  }
  int ans = 1;
  dp[1] = 1;
  for (int i = 2; i <= N; i++) {
    if (ispal(1, i)) dp[i] = dp[i / 2] + 1;
    ans += dp[i];
  }
  printf("%d\n", ans);
  return 0;
}
