#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch - '0' < 0 || ch - '0' > 9) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch - '0' >= 0 && ch - '0' <= 9) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, len;
char s[5000010], t[5000010 * 2];
int f[5000010];
void pre() {
  for (int i = 1; i <= 2 * n + 1; i++) {
    if (i & 1)
      t[i] = '#';
    else
      t[i] = s[i / 2];
  }
  len = 2 * n + 1;
}
int R[5000010 * 2];
void Manacher() {
  int p = 1, mx = 1;
  R[1] = 1;
  for (int i = 2; i <= len; i++) {
    if (mx < i)
      R[i] = 1;
    else {
      int j = 2 * p - i;
      R[i] = min(R[j], mx - i);
    }
    while (t[i + R[i]] == t[i - R[i]] && i + R[i] < len && i - R[i] > 0) R[i]++;
    if (i + R[i] - 1 > mx) {
      mx = i + R[i] - 1;
      p = i;
    }
  }
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  pre();
  Manacher();
  for (int i = 1; i <= len; i++) {
    int l = i - R[i] + 1, r = i + R[i] - 1;
    l = (l + 1) / 2;
    r /= 2;
    if (l > r) continue;
    if (l == 1) f[r] = f[r / 2] + 1;
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) ans += f[i];
  cout << ans << endl;
  return 0;
}
