#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e6 + 10;
const int INF = 0x3f3f3f3f;
char str[maxn];
int dp[maxn];
unsigned long long f1[maxn], f2[maxn];
int main() {
  scanf("%s", str + 1);
  int l = strlen(str + 1);
  unsigned long long ans = 1;
  long long sum = 0;
  dp[0] = 0;
  for (int i = 1; i <= l; i++) {
    if (str[i] >= '0' && str[i] <= '9') {
      str[i] = str[i] - '0';
    } else if (str[i] >= 'a' && str[i] <= 'z') {
      str[i] = str[i] - 'a' + 10;
    } else {
      str[i] = str[i] - 'A' + 36;
    }
    f1[i] = f1[i - 1] * 131 + str[i];
    f2[i] = (f2[i - 1] + str[i] * ans);
    ans *= 131;
    if (f1[i] == f2[i]) {
      dp[i] = dp[i >> 1] + 1;
      sum += dp[i];
    }
  }
  printf("%lld\n", sum);
  return 0;
}
