#include <bits/stdc++.h>
using namespace std;
char ch[5005000];
int f[5005000];
int main() {
  gets(ch);
  int l = 0, r = 0, tmp = 1, ans = 0, len = strlen(ch);
  for (int i = 0; i < len; i++) {
    l = l * 103 + ch[i];
    r = r + ch[i] * tmp;
    tmp *= 103;
    if (l == r) f[i + 1] = f[(i + 1) / 2] + 1;
    ans += f[i + 1];
  }
  printf("%d\n", ans);
  return 0;
}
