#include <bits/stdc++.h>
using namespace std;
vector<int> calcPalindromes(const char *str) {
  int n = strlen(str);
  vector<int> res = vector<int>((n << 1) | 1);
  int m = 0, i = 0, pl = 0;
  while (i < n) {
    if (i > pl && str[i - pl - 1] == str[i]) {
      pl += 2;
      i++;
      continue;
    }
    res[m++] = pl;
    int s = m - 2, e = s - pl, j;
    for (j = s; j > e; j--) {
      int d = j - e - 1;
      if (res[j] >= d) {
        pl = d;
        break;
      }
      res[m++] = min(d, res[j]);
    }
    if (j == e) {
      pl = 1;
      i++;
    }
  }
  res[m++] = pl;
  int s = m - 2, e = s - ((n << 1) + 1 - m);
  for (int i = s; i > e; i--) {
    int d = i - e - 1;
    res[m++] = min(d, res[i]);
  }
  return res;
}
const int MAXN = 5000001;
int n;
char s[MAXN];
vector<int> length, degree;
int main() {
  scanf("%s", s);
  n = strlen(s);
  length = calcPalindromes(s);
  degree = vector<int>(n + 1);
  for (int i = (1); i < ((n << 1) + 1); i++) {
    if (i == length[i]) {
      degree[(i + length[i]) >> 1] = 1;
    }
  }
  long long res = 0;
  for (int i = (1); i < (n + 1); i++) {
    if (degree[i]) {
      degree[i] = degree[i / 2] + 1;
      res += degree[i];
    }
  }
  printf("%I64d\n", res);
  return 0;
}
