#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e6 + 5;
char s[maxn];
int n;
struct haash {
  int seed, mod, hs[maxn], bas[maxn];
  void init() {
    bas[0] = 1;
    for (int i = 1; i < n + 1; ++i) {
      bas[i] = 1ll * bas[i - 1] * seed % mod;
      hs[i] = 1ll * hs[i - 1] * seed % mod + s[i];
      if (hs[i] >= mod) hs[i] -= mod;
    }
  }
  int getsum(int *h, int l, int r) {
    int res = h[r] - 1ll * h[l - 1] * bas[r - l + 1] % mod;
    if (res < 0) res += mod;
    return res;
  }
} hh[2];
void hash_init() {
  hh[0].seed = 18051329, hh[0].mod = 998244353;
  hh[0].init();
  reverse(s + 1, s + n + 1);
  hh[1].seed = 18051329, hh[1].mod = 998244353;
  hh[1].init();
}
int ww[maxn];
void solve() {
  long long ans = 1;
  ww[1] = 1;
  for (int i = 2; i < n + 1; ++i) {
    if (hh[0].getsum(hh[0].hs, 1, i / 2) ==
        hh[1].getsum(hh[1].hs, n - i + 1, n - (i + 1) / 2))
      ww[i] = ww[i / 2] + 1;
    ans += ww[i];
  }
  printf("%lld\n", ans);
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  hash_init();
  solve();
}
