#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e6 + 5;
char s[maxn];
unsigned long long Hash1[maxn], Hash2[maxn];
unsigned long long sum1[maxn], sum2[maxn];
unsigned long long f[maxn];
long long dp[maxn];
long long sum;
int n;
int main() {
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  n = len;
  memset(dp, 0, sizeof(dp));
  f[0] = 1;
  sum = 0;
  for (int i = 1; i <= len; i++) {
    f[i] = f[i - 1] * 131;
  }
  for (int i = 1; i <= n; i++) {
    Hash1[i] = (s[i] - 'a' + 1) * f[i - 1];
  }
  for (int i = n; i >= 1; i--) {
    Hash2[i] = (s[i] - 'a' + 1) * f[n - i];
  }
  for (int i = 1; i <= n; i++) {
    Hash1[i] += Hash1[i - 1];
  }
  for (int i = n; i >= 1; i--) {
    Hash2[i] += Hash2[i + 1];
  }
  unsigned long long ans1, ans2;
  for (int i = 1; i <= len; i++) {
    int temp2 = len - i;
    ans1 = Hash1[i];
    ans2 = Hash2[1] - Hash2[i + 1];
    ans1 *= f[temp2];
    if (ans1 == ans2) {
      dp[i] = dp[i / 2] + 1;
    }
  }
  for (int i = 1; i <= len; i++) sum += dp[i];
  printf("%lld\n", sum);
  return 0;
}
