#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxn = 5110000;
;
unsigned long long H1[maxn], H2[maxn], xp[maxn], ha, hb, x = 123;
int dp[maxn], len;
char buf[maxn], rbuf[maxn];
void init() {
  int i;
  len = strlen(buf);
  H1[len] = H2[len] = 0;
  xp[0] = 1;
  for (i = len - 1; i >= 0; i--) {
    H1[i] = H1[i + 1] * x + buf[i];
    H2[i] = H2[i + 1] * x + rbuf[i];
    xp[len - i] = xp[len - i - 1] * x;
  }
}
unsigned long long getHash(unsigned long long *HS, int s, int L) {
  return HS[s] - HS[s + L] * xp[L];
}
int main() {
  int i, ans;
  while (~scanf("%s", buf)) {
    ans = 0, len = strlen(buf);
    for (i = 0; i < len; i++) rbuf[i] = buf[len - i - 1];
    init();
    ans = dp[0] = 1;
    for (i = 1; i < len; i++) {
      ha = getHash(H1, 0, i + 1);
      hb = getHash(H2, len - i - 1, i + 1);
      if (ha == hb) {
        if (i & 1)
          dp[i] = dp[i / 2] + 1;
        else
          dp[i] = dp[i / 2 - 1] + 1;
      } else
        dp[i] = 0;
      ans += dp[i];
    }
    printf("%d\n", ans);
  }
  return 0;
}
