#include <bits/stdc++.h>
using namespace std;
int n;
int z[10000001];
int kp[10000001];
char s[10000001];
void z_func() {
  int L = 0, R = 0;
  for (int i = 1; i < n; ++i) {
    if (i > R) {
      L = R = i;
      while (R < n && s[R - L] == s[R]) R++;
      z[i] = R - L;
      R--;
    } else {
      int k = i - L;
      if (z[k] < R - i + 1)
        z[i] = z[k];
      else {
        L = i;
        while (R < n && s[R - L] == s[R]) R++;
        z[i] = R - L;
        R--;
      }
    }
  }
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  for (int i = 0; i < n; ++i) s[i + n] = s[n - i - 1];
  n *= 2;
  z_func();
  int ans = 1;
  kp[0] = 1;
  for (int i = 1; i < n / 2; ++i) {
    int sz = (i + 1) / 2;
    int ps = i - sz + 1;
    if (z[n - i - 1] >= i + 1) {
      kp[i] = kp[sz - 1] + 1;
    }
    ans += kp[i];
  }
  printf("%d\n", ans);
  return 0;
}
