#include <bits/stdc++.h>
using namespace std;
const int c = 10000100;
char s[c];
int z[c];
int p[c];
int n, ans;
int main() {
  gets(s);
  n = strlen(s);
  memcpy(s + n, s, (n + 1) * sizeof(char));
  reverse(s + n, s + 2 * n);
  int i, j;
  z[0] = 2 * n;
  int lf = 0, rg = 0;
  for (i = 1; i < 2 * n; ++i) {
    if (i > rg) {
      lf = i;
      for (j = i; j < 2 * n; ++j)
        if (s[j] != s[j - lf]) break;
      rg = j - 1;
      z[i] = rg - lf + 1;
    } else if (i + z[i - lf] - 1 < rg)
      z[i] = z[i - lf];
    else {
      lf = i;
      for (j = rg + 1; j < 2 * n; ++j)
        if (s[j] != s[j - lf]) break;
      rg = j - 1;
      z[i] = rg - lf + 1;
    }
  }
  p[0] = 1;
  ans = 1;
  for (i = 1; i < n; ++i) {
    if (z[2 * n - i - 1] >= (i + 1) / 2) p[i] = p[(i - 1) / 2] + 1;
    ans += p[i];
  }
  printf("%d", ans);
  return 0;
}
