#include <bits/stdc++.h>
using namespace std;
const int maxn = 5 * 1e6 + 10;
char st[maxn];
char s[maxn << 1];
int p[maxn << 1];
int ans[maxn];
void init(int le) {
  for (int i = le - 1; i >= 0; --i) {
    s[2 * i + 2] = st[i];
    s[2 * i + 3] = '*';
  }
  s[0] = '$';
  s[1] = '*';
}
void manacher(int le) {
  int mx = 0, id = 0;
  for (int i = 1; i < 2 * le + 2; ++i) {
    p[i] = mx > i ? min(p[id * 2 - i], mx - i) : 1;
    while (s[i + p[i]] == s[i - p[i]]) p[i]++;
    if (i + p[i] > mx) {
      mx = i + p[i];
      id = i;
    }
  }
}
int main() {
  long long res = 0;
  scanf("%s", st);
  int le = strlen(st);
  init(le);
  manacher(le);
  int u = 2;
  for (int i = 0; i < le; ++i) {
    if (p[i + 2] != i + 2) {
      ans[i] = 0;
    } else {
      ans[i] = ans[(i - 1) / 2] + 1;
      ans[i] = max(ans[i], 1);
    }
    res += ans[i];
  }
  printf("%lld\n", res);
}
