#include <bits/stdc++.h>
using namespace std;
const int MaxN = 5000003;
char S[MaxN << 1];
int L, N, f[MaxN << 1], ind[MaxN];
int main() {
  gets(S + 1);
  L = strlen(S + 1);
  for (int i = 1; i <= L; ++i) S[2 * L + 2 - i] = S[i];
  S[L + 1] = '.';
  N = L * 2 + 1;
  S[N + 1] = 0;
  f[1] = N;
  int p = 0;
  for (; S[p + 1] == S[p + 2]; ++p)
    ;
  f[2] = p;
  p = 2;
  for (int i = 3; i <= N; ++i) {
    int t = p + f[p] - 1;
    if (t < i) {
      int &len = f[i];
      for (len = 0; S[len + 1] == S[i + len]; ++len)
        ;
      p = i;
    } else {
      int rem = t - i + 1;
      f[i] = f[i - p + 1];
      if (f[i] >= rem) {
        f[i] = rem;
        int &len = f[i];
        for (; S[len + 1] == S[i + len]; ++len)
          ;
        p = i;
      }
    }
  }
  long long res = 1;
  ind[1] = 1;
  for (int i = 2; i <= L; ++i) {
    int n = i >> 1;
    if (f[N + 1 - i] >= n)
      ind[i] = ind[n] + 1;
    else
      ind[i] = 0;
    res += ind[i];
  }
  cout << res << endl;
}
