#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string str;
  cin >> str;
  long long int prime1 = 137;
  long long int store = 1, val;
  long long int forward = 0, revhash = 0;
  long long int len = str.size();
  long long int hash[len + 1];
  long long int ans = 0;
  hash[0] = 0;
  for (long long int i = 1; i <= len; i++) {
    val = str[i - 1];
    forward = (forward * prime1 + val) % 1000000007;
    revhash += (store * val) % 1000000007;
    revhash = revhash % 1000000007;
    store = (store * prime1) % 1000000007;
    if (revhash != forward) {
      hash[i] = 0;
      continue;
    }
    hash[i] = hash[i / 2] + 1;
    ans += hash[i];
  }
  cout << ans;
  return 0;
}
