#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b, long long c) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b & 1) x = (x * y) % c;
    y = (y * y) % c;
    b /= 2;
  }
  return x % c;
}
int dx[] = {0, -1, 0, 1};
int dy[] = {-1, 0, 1, 0};
int dr[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dc[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int N = 5e6 + 5;
char s[N];
long long BASE[2] = {100000009, 100000007}, MOD[2] = {1000000007, 1000000009};
long long B[N][1], IB[N][1], H[N][1], RH[N][1];
void init() {
  for (int k = 0; k < 1; ++k) {
    long long b = BASE[k], m = MOD[k];
    B[0][k] = 1;
    for (int i = 1; i <= N - 1; ++i) {
      B[i][k] = (B[i - 1][k] * b) % m;
    }
    IB[N - 1][k] = power(B[N - 1][k], m - 2, m);
    for (int i = N - 2; i >= 0; --i) {
      IB[i][k] = (IB[i + 1][k] * b) % m;
    }
  }
}
void build(char *s) {
  int len = strlen(s);
  for (int k = 0; k < 1; ++k) {
    long long b = BASE[k], m = MOD[k];
    H[0][k] = RH[len + 1][k] = 0;
    for (int i = 0, j = 1; s[i]; ++i, ++j) {
      H[j][k] = (H[j - 1][k] + (s[i] * B[i][k]) % m) % m;
    }
    for (int i = len - 1, j = len, l = 0; i >= 0; --i, --j, ++l) {
      RH[j][k] = (RH[j + 1][k] + (s[i] * B[l][k]) % m) % m;
    }
  }
}
long long forHash(int i, int j, int len) {
  i++, j++;
  long long sub[2];
  for (int k = 0; k < 1; ++k) {
    long long b = BASE[k], m = MOD[k];
    sub[k] = ((H[j][k] + m - H[i - 1][k]) * IB[i - 1][k]) % m;
  }
  return (sub[0] << 32);
}
long long revHash(int i, int j, int len) {
  i++, j++;
  long long sub[2];
  for (int k = 0; k < 1; ++k) {
    long long b = BASE[k], m = MOD[k];
    sub[k] = ((RH[i][k] + m - RH[j + 1][k]) * IB[len - j][k]) % m;
  }
  return (sub[0] << 32);
}
long long DP[N];
int main() {
  init();
  scanf("%s", s);
  int len = strlen(s);
  build(s);
  DP[1] = 1;
  long long ans = 1;
  for (int i = 2; i <= len; ++i) {
    long long ff = forHash(0, i - 1, len), rr = revHash(0, i - 1, len);
    if (ff == rr) {
      long long mid = (1 + i) / 2;
      if (i & 1) {
        DP[i] = DP[mid - 1] + 1;
      } else {
        DP[i] = DP[mid] + 1;
      }
    }
    ans += DP[i];
  }
  printf("%lld\n", ans);
  return 0;
}
