#include <bits/stdc++.h>
using namespace std;
int n, p[5000010 * 2], Dp[5000010];
char S[5000010 * 2];
long long Ans;
void Manacher() {
  int m = 0, x = 1;
  for (int i = 1; i <= n; i++) {
    p[i] = 1;
    if (m > i) p[i] = min(m - i, p[2 * x - i]);
    while (S[i - p[i]] == S[i + p[i]]) p[i]++;
    if (i - p[i] + 1 == 1 && p[i] != 1) {
      Dp[p[i] - 1] = Dp[(p[i] - 1) / 2] + 1;
      Ans += Dp[p[i] - 1];
    }
    if (m < i + p[i] - 1) m = i + p[i] - 1, x = i;
  }
}
int main() {
  scanf("%s", S);
  n = (int)strlen(S);
  for (int i = n; i >= 0; i--) S[i * 2 + 2] = S[i], S[i * 2 + 1] = '#';
  S[0] = '$';
  n = n * 2 + 1;
  Manacher();
  cout << Ans << endl;
  return 0;
}
