#include <bits/stdc++.h>
using namespace std;
const int INF = 1500000000;
const int MOD = 1000000007;
const int HASH = 137;
int prefix[5000000 + 1];
char text[5000000 + 1];
int Power(int x) {
  if (x == 0) return 1;
  if (prefix[x] == -1) {
    int k = Power(x >> 1);
    if (x % 2)
      prefix[x] = k * k * HASH;
    else
      prefix[x] = k * k;
  }
  return prefix[x];
}
int main() {
  scanf("%s", text);
  int L = strlen(text);
  int H[L], RH[L], dp[L], Ans = 1;
  for (int i = 0; i < L; i++) prefix[i] = -1;
  H[0] = text[0];
  for (int i = 1; i < L; i++) H[i] = H[i - 1] * HASH + text[i];
  RH[L - 1] = text[L - 1];
  for (int i = L - 2; i >= 0; i--) RH[i] = RH[i + 1] * HASH + text[i];
  dp[0] = 1;
  for (int i = 1; i < L; i++) {
    int half = (i + 1) >> 1;
    if (i == L - 1 && H[half - 1] == RH[i - half + 1])
      dp[i] = dp[half - 1] + 1;
    else if (H[half - 1] == RH[i - half + 1] - RH[i + 1] * Power(half))
      dp[i] = dp[half - 1] + 1;
    else
      dp[i] = 0;
    Ans += dp[i];
  }
  printf("%d\n", Ans);
  return 0;
}
