#include <bits/stdc++.h>
using namespace std;
char s[5 * 1000100];
int f[5 * 1000100];
int X = 103;
int Y = 1;
int main() {
  scanf("%s", s);
  int len = strlen(s);
  int l = 0, r = 0;
  int sol = 0;
  for (int i = 0; i < len; i++) {
    l *= X;
    l += s[i];
    r += s[i] * Y;
    Y *= X;
    if (l == r) f[i + 1] = f[(i + 1) / 2] + 1;
    sol += f[i + 1];
  }
  printf("%d\n", sol);
  return 0;
}
