#include <bits/stdc++.h>
using namespace std;
const int N = 5e6 + 10;
const long long mod = 1000696969;
long long dp[N], h[N], rh[N], pw[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  s = '.' + s + '.';
  for (int i = 1; i <= n; i++)
    h[i] = (h[i - 1] * 256 + (long long)(s[i])) % mod;
  for (int i = n; i >= 1; i--)
    rh[i] = (rh[i + 1] * 256 + (long long)(s[i])) % mod;
  pw[0] = 1;
  for (int i = 1; i < N; i++) pw[i] = pw[i - 1] * 256 % mod;
  long long ans = dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (h[i] == (rh[1] - rh[i + 1] * pw[i] % mod + mod) % mod)
      dp[i] = dp[i / 2] + 1;
    ans += dp[i];
  }
  cout << ans;
  return 0;
}
