#include <bits/stdc++.h>
double const PI = 4 * atan(1.0);
using namespace std;
char s[5000111];
int f1[5000111] = {0}, f2[5000111] = {0}, f[5000111];
int n, res;
void manacher_odd() {
  int l = 0, r = -1, k;
  for (int i = 1; i < n; i++) {
    k = (i > r ? 0 : min(f1[l + r - i], r - i)) + 1;
    while (i - k >= 0 && i + k < n && s[i - k] == s[i + k]) k++;
    f1[i] = --k;
    if (i + f1[i] > r) l = i - f1[i], r = i + f1[i];
  }
}
void manacher_even() {
  int l = 0, r = -1, k;
  for (int i = 1; i < n; i++) {
    k = (i > r ? 0 : min(f2[l + r - i], r - i + 1)) + 1;
    while (i - k >= 0 && i + k - 1 < n && s[i - k] == s[i + k - 1]) k++;
    f2[i] = --k;
    if (i + f2[i] - 1 > r) l = i - f2[i], r = i + f2[i] - 1;
  }
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  manacher_odd();
  manacher_even();
  f[0] = 1;
  res = 1;
  for (int i = 1; i < n; i++) {
    if (i & 1) {
      if (f2[(i + 1) / 2] >= (i + 1) / 2)
        f[i] = f[(i - 1) / 2] + 1;
      else
        f[i] = 0;
    } else {
      if (f1[i / 2] >= i / 2)
        f[i] = f[i / 2 - 1] + 1;
      else
        f[i] = 0;
    }
    res += f[i];
  }
  printf("%d", res);
}
