#include <bits/stdc++.h>
using namespace std;
const int N = 5e6 + 10, M = 101, mod = 1e9 + 7;
long long m[N], p[N], s[N], dp[N];
string a;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  m[0] = 1;
  for (int i = 1; i < N; i++) m[i] = m[i - 1] * M % mod;
  cin >> a;
  int n = a.size();
  s[n - 1] = a[n - 1];
  for (int i = n - 2; 0 <= i; i--) s[i] = (s[i + 1] * M % mod + a[i]) % mod;
  p[0] = a[0];
  for (int i = 1; i < n; i++) p[i] = (p[i - 1] * M % mod + a[i]) % mod;
  dp[0] = 1;
  for (int i = 1; i < n; i++) {
    long long res = s[(i + 2) / 2];
    res -= s[i + 1] * m[(i + 1) / 2] % mod;
    res %= mod;
    res += mod;
    res %= mod;
    if (p[(i - 1) / 2] == res) dp[i] = 1 + dp[(i - 1) / 2];
  }
  int ans = 0;
  for (int i = 0; i < n; i++) ans += dp[i];
  cout << ans;
}
