#include <bits/stdc++.h>
using namespace std;
const int Maxn = 5555555;
const int Base = 727;
const unsigned long long Mod = 1e9 + 9;
string s;
long long dp[Maxn], n;
long long ans, pw[Maxn], H[Maxn], R[Maxn];
long long mul(long long a, long long b) { return (a * b) % Mod; }
long long sum(long long a, long long b) { return (a + b + Mod) % Mod; }
long long get(int l, int r) {
  return sum(H[r], -(mul(H[l - 1], pw[r - l + 1])));
}
long long getR(int l, int r) {
  l = n - l + 1;
  r = n - r + 1;
  return sum(R[l], -(mul(R[r - 1], pw[l - r + 1])));
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  pw[0] = 1;
  for (int i = 1; i < Maxn; i++) pw[i] = mul(pw[i - 1], Base);
  cin >> s;
  n = s.size();
  H[1] = int(s[0]);
  for (int i = 2; i <= n; i++) H[i] = sum(mul(H[i - 1], Base), int(s[i - 1]));
  reverse(s.begin(), s.end());
  R[1] = int(s[0]);
  for (int i = 2; i <= n; i++) R[i] = sum(mul(R[i - 1], Base), int(s[i - 1]));
  reverse(s.begin(), s.end());
  for (int i = 1; i <= n; i++) {
    int mid = i >> 1;
    if (get(1, mid) == getR(i - mid + 1, i))
      dp[i] = dp[mid] + 1;
    else
      dp[i] = 0;
    ans += dp[i];
  }
  cout << ans;
  return (0);
}
