#include <bits/stdc++.h>
using namespace std;
char s[5000006];
int pre[5000006], n, sum = 1;
int h1, h2, p = 127, pp = 1;
int main() {
  pre[1] = 1;
  gets(s);
  for (int l = 2; s[l - 1]; ++l) {
    if (l & 1) {
      h2 = (h2 - s[l >> 1] * pp) * p + s[l - 1];
      pp *= p;
    } else {
      h1 = h1 + s[(l >> 1) - 1] * pp;
      h2 = h2 * p + s[l - 1];
    }
    if (h1 == h2) {
      pre[l] = pre[l >> 1] + 1;
      sum += pre[l];
    }
  }
  printf("%d\n", sum);
  return 0;
}
