#include <bits/stdc++.h>
using namespace std;
long long inpL;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string inp;
  cin >> inp;
  long long n = inp.length();
  long long pref[n + 1], suff[n + 1], power[n + 2];
  long long dp[n + 1];
  power[0] = 1;
  dp[0] = 0;
  inpL = n;
  pref[0] = 0;
  suff[0] = 0;
  string t = inp;
  reverse(t.begin(), t.end());
  for (long long i = 1; i < n + 1; i++) {
    long long per = power[i - 1];
    pref[i] = (pref[i - 1] + ((inp[i - 1] - '0' + 1) * (per))) % 1000000007;
    suff[i] = (suff[i - 1] + ((t[i - 1] - '0' + 1) * (per))) % 1000000007;
    power[i] = (power[i - 1] * 83) % 1000000007;
  }
  long long ans = 0;
  string temp;
  for (long long i = 0; i < n; i++) {
    temp.push_back(inp[i]);
    long long len = i + 1;
    if (len % 2 == 0) {
      if (((pref[len / 2] * power[inpL - len]) % 1000000007) ==
          (suff[inpL - (len / 2)] - suff[inpL - len] + 1000000007) %
              1000000007) {
        dp[len] = dp[len / 2] + 1;
        ans += dp[len];
      } else
        dp[len] = 0;
    } else if (len % 2 == 1) {
      if (((pref[len / 2] * power[inpL - len]) % 1000000007) ==
          ((suff[inpL - (len / 2) - 1] - suff[inpL - len] + 1000000007) %
           1000000007)) {
        dp[len] = dp[len / 2] + 1;
        ans += dp[len];
      } else
        dp[len] = 0;
    }
  }
  cout << ans << '\n';
  return 0;
}
