#include <bits/stdc++.h>
using namespace std;
const int maxn = 5 * 1000000 + 100;
char str[maxn << 1], s[maxn];
int p[maxn << 1];
int ans;
int n;
int f[maxn << 1];
void Init(void) {
  str[0] = '$', str[1] = '#';
  for (int i = 0; i < n; i++) {
    str[i * 2 + 2] = s[i];
    str[i * 2 + 3] = '#';
  }
  int nn = 2 * n + 2;
  str[nn] = 0;
  int mx = 0, id;
  for (int i = 1; i < nn; i++) {
    if (mx > i) {
      p[i] = min(p[2 * id - i], mx - i);
    } else
      p[i] = 1;
    while (str[i + p[i]] == str[i - p[i]]) p[i]++;
    if (i + p[i] > mx) mx = i + p[i], id = i;
  }
}
void solve(void) {
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    int l = 2, r = 2 * i;
    int m = (l + r) >> 1;
    if (p[m] * 2 - 1 >= r - l + 1) f[r] = f[m - 1 + ((m % 2) ? 0 : -1)] + 1;
    ans += f[r];
  }
  printf("%I64d\n", ans);
}
int main(void) {
  scanf("%s", s);
  n = strlen(s);
  Init();
  solve();
  return 0;
}
