#include <bits/stdc++.h>
using namespace std;
int L;
char str[5333333];
char strrr[5333333 * 2];
int Manacher[5333333 * 2];
int srt[5333333];
void MAN() {
  int i;
  int mx = 0;
  int id;
  for (i = 1; i <= 2 * L - 1; i++) {
    if (mx > i)
      Manacher[i] = min(Manacher[2 * id - i], mx - i);
    else
      Manacher[i] = 1;
    for (; i - Manacher[i] >= 1 &&
           strrr[i + Manacher[i]] == strrr[i - Manacher[i]];
         Manacher[i]++)
      ;
    if (Manacher[i] + i > mx) {
      mx = Manacher[i] + i;
      id = i;
    }
  }
}
int main() {
  while (gets(str)) {
    L = strlen(str);
    for (int i = 0; i <= L - 2; i++) {
      strrr[2 * (i + 1) - 1] = str[i];
      strrr[2 * (i + 1)] = '#';
    };
    strrr[2 * (L)-1] = str[L - 1];
    MAN();
    long long sum = 0;
    srt[0] = 1;
    sum = 1;
    for (int i = 1; i <= L - 1; i++) {
      if (Manacher[i + 1] == i + 1) {
        srt[i] = srt[(i + 1) / 2 - 1] + 1;
        sum += srt[i];
      }
    }
    printf("%lld\n", sum);
    memset(str, ' ', sizeof(str));
    memset(strrr, ' ', sizeof(strrr));
    memset(Manacher, 0, sizeof(Manacher));
    memset(srt, 0, sizeof(srt));
  }
}
