#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T& x) {
  bool fu = 0;
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  if (c == '-') fu = 1, c = getchar();
  for (x = 0; c > 32; c = getchar()) x = x * 10 + c - '0';
  if (fu) x = -x;
};
template <class T>
inline void read(T& x, T& y) {
  read(x);
  read(y);
}
template <class T>
inline void read(T& x, T& y, T& z) {
  read(x);
  read(y);
  read(z);
}
inline char getc() {
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  return c;
}
const int mod = int(1e9) + 7;
const int L = 5000010;
int n, m, i, j, k, l, p, ans;
char A[L], a[L];
int r[L];
long long H[L], G[L], c[L];
long long get0(int x, int y) {
  if (x > y) return 0;
  return ((H[y] - H[x - 1] * c[y - x + 1]) % mod + mod) % mod;
}
long long get1(int x, int y) {
  if (x < y) return 0;
  return ((G[y] - G[x + 1] * c[x - y + 1]) % mod + mod) % mod;
}
int main() {
  scanf("%s", a + 1);
  n = strlen(a + 1);
  c[0] = 1;
  for (i = 1; i <= n; i++) c[i] = c[i - 1] * 128 % mod;
  for (i = 1; i <= n; i++) H[i] = (H[i - 1] * 128 + a[i]) % mod;
  for (i = n; i >= 1; i--) G[i] = (G[i + 1] * 128 + a[i]) % mod;
  for (i = 1; i <= (n + 1) / 2; i++) {
    if (get0(1, 2 * i - 1) == get1(2 * i - 1, 1))
      ans += r[2 * i - 1] = r[i - 1] + 1;
    if (2 * i <= n && get0(1, 2 * i) == get1(2 * i, 1))
      ans += r[2 * i] = r[i] + 1;
  }
  printf("%d\n", ans);
  return 0;
}
