#include <bits/stdc++.h>
inline int cmp(double x, double y = 0, double tol = 1e-9) {
  return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1;
}
std::string str;
int P[10000007], D[10000007];
int n;
void manacher() {
  int i2, l, r, Ri;
  int C = -1, R = -1;
  n = 2 * (str.size() - 1);
  for (int i = 0; i <= n; ++i) {
    i2 = 2 * C - i;
    P[i] = (R >= i) ? std::min(R - i + 1, P[i2]) : !(i % 2);
    l = (i - P[i]) >> 1;
    r = (i + P[i] + 1) >> 1;
    while (l >= 0 && r < str.size() && str[l] == str[r]) {
      P[i] += 2;
      l -= 1;
      r += 1;
    }
    Ri = P[i] ? ((i + P[i]) >> 1) << 1 : i;
    if (Ri > R) {
      C = i;
      R = Ri;
    }
  }
}
int main() {
  std::cin >> str;
  manacher();
  long long int sum = D[0] = 1;
  for (int i = 1; i <= n; ++i) {
    if (P[i] == i + 1)
      D[i] = D[(i - 1) / 2] + 1;
    else
      D[i] = 0;
    sum += D[i];
  }
  std::cout << sum << std::endl;
  return 0;
}
