#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const long long N = 5e6 + 3;
long long dp[N];
int main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string str;
  unsigned long long temp = 1, p = 0, q = 0;
  cin >> str;
  long long ans = 0;
  long long pppp = str.size();
  for (int i = 0; i < str.size(); i++) {
    p = (p * 131 + str[i]) % mod;
    q = (temp * (str[i]) + q) % mod;
    ;
    temp *= 131;
    temp %= mod;
    if (p == q) {
      if (i == 0)
        dp[i]++, ans += dp[i];
      else {
        dp[i] = dp[(i - 1) / 2] + 1;
        ans += dp[i];
      }
    }
  }
  cout << ans << endl;
}
