#include <bits/stdc++.h>
int p[10000010];
int a[10000010];
char s[10000010];
int n;
int min(int x, int y) { return x < y ? x : y; }
void calclcp(char *s) {
  int l, r, l1;
  l = r = 1;
  p[0] = n;
  while (l < n) {
    if (s[r] == s[r - l])
      r++;
    else {
      l1 = l;
      p[l] = r - l;
      while (l < n && l < r && (s[r] != s[r - l] || l + p[l - 1] < r)) {
        p[l] = min(p[l - l1], r - l);
        l++;
      }
      if (l == r)
        while (l < n && s[r] != s[0]) {
          p[l] = 0;
          l++;
          r++;
        }
    }
  }
}
int main() {
  int i, m;
  long long ans = 0;
  scanf("%s", s);
  n = strlen(s);
  s[n] = '#';
  for (i = 1; i <= n; i++) s[n + i] = s[n - i];
  s[2 * n + 1] = 0;
  m = n;
  n = 2 * n + 1;
  s[n] = 0;
  calclcp(s);
  a[0] = 1;
  ans = 1;
  for (i = 1; i < m; i++) {
    if ((p[n - i - 1] << 1) >= i + 1) a[i] = a[(i - 1) >> 1] + 1;
    ans += a[i];
  }
  printf("%lld\n", ans);
  return 0;
}
