#include <bits/stdc++.h>
using namespace std;
const int M4 = 1e4 + 10, M5 = 1e5 + 10, M6 = 1e6 + 10;
const int P = 79, maxn = 5000 * 1000 + 10, k = '0' - 1;
const long long mod = 1e9 + 7;
long long p[maxn], h[maxn], h2[maxn];
int n, f[maxn];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string s;
  cin >> s;
  n = (int)(s).size();
  p[0] = 1;
  for (int i = 1; i < maxn; i++) p[i] = (p[i - 1] * P) % mod;
  h[1] = s[0] - k;
  for (int i = 1; i < n; i++) h[i + 1] = (h[i] * P + s[i] - k) % mod;
  h2[1] = s[0] - k;
  for (int i = 1; i < n; i++) h2[i + 1] = (h2[i] + (s[i] - k) * p[i]) % mod;
  f[1] = 1;
  long long ans = 1;
  for (int i = 2; i <= n; i++) {
    int t = i / 2;
    long long h0 = (h[t] * p[(i + 1) / 2]) % mod,
              h1 = (h2[i] - h2[i - t] + mod) % mod;
    if (h0 == h1) f[i] = f[i / 2] + 1;
    ans += f[i];
  }
  cout << ans;
  return 0;
}
