#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5000050;
int dp[MAXN];
char str[MAXN];
int main() {
  scanf("%s", str + 1);
  unsigned int left = 0, right = 0, e = 107, u = 1;
  int ans = 0;
  for (int i = 1; str[i]; ++i) {
    left = left * e + str[i];
    right = right + u * str[i];
    u *= e;
    if (left == right) dp[i] = dp[i / 2] + 1;
    ans += dp[i];
  }
  printf("%d\n", ans);
  return 0;
}
