#include <bits/stdc++.h>
const long long Base = 47289, mod = 998244353;
long long base = 1;
std::string s;
long long n, ans, pre, lst, f[5000001];
int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  std::cin >> s;
  n = s.size();
  for (long long i = 0; i <= n - 1; i++) {
    pre = (pre * Base + (long long)s[i] + mod) % mod;
    lst = (lst + (long long)(s[i]) * base + mod) % mod;
    base = base * Base % mod;
    if (pre == lst) f[i] = f[(i - 1) / 2] + 1, ans += f[i];
  }
  std::cout << ans << '\n';
  return 0;
}
