#include <bits/stdc++.h>
long long dp[5000005];
char s[5000005];
using namespace std;
int main() {
  long long ans = 0, l = 0, r = 0, k = 1;
  scanf("%s", s);
  for (int i = 0; s[i]; i++) {
    l = l * 33 + s[i] - 'a';
    r = r + (s[i] - 'a') * k;
    k = k * 33;
    if (l == r) dp[i + 1] = dp[(i + 1) / 2] + 1;
    ans += dp[i + 1];
  }
  cout << ans << "\n";
  return 0;
}
