#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
long long readIn() {
  long long a = 0;
  bool positive = true;
  char ch = getchar();
  while (!(ch == '-' || std::isdigit(ch))) ch = getchar();
  if (ch == '-') {
    positive = false;
    ch = getchar();
  }
  while (std::isdigit(ch)) {
    a = a * 10 - (ch - '0');
    ch = getchar();
  }
  return positive ? -a : a;
}
void printOut(long long x) {
  char buffer[20];
  int length = 0;
  if (x < 0)
    putchar('-');
  else
    x = -x;
  do buffer[length++] = -(x % 10) + '0';
  while (x /= 10);
  do putchar(buffer[--length]);
  while (length);
  putchar('\n');
}
const int maxn = int(6e6) + 5;
struct Manacher {
  char str[maxn * 2];
  int length;
  int rl[maxn * 2];
  void init(const char* s) {
    str[length++] = '#';
    for (; *s != '\0'; s++) {
      str[length++] = *s;
      str[length++] = '#';
    }
  }
  void manacher() {
    int center;
    int maxRight = -1;
    for (int i = 0; i < length; i++) {
      if (i <= maxRight) {
        rl[i] = std::min(rl[2 * center - i], maxRight - i + 1);
      } else
        rl[i] = 1;
      while (i - rl[i] >= 0 && i + rl[i] < length &&
             str[i - rl[i]] == str[i + rl[i]])
        rl[i]++;
      if (i + rl[i] - 1 > maxRight) {
        maxRight = i + rl[i] - 1;
        center = i;
      }
    }
  }
  inline bool judge(int i) { return rl[i + 1] >= i + 2; }
} manacher;
int n;
char str[maxn];
int f[maxn];
inline bool isValid(char ch) { return std::isalpha(ch) || std::isdigit(ch); }
void run() {
  char ch = getchar();
  while (!isValid(ch)) ch = getchar();
  while (isValid(ch)) {
    str[n++] = ch;
    ch = getchar();
  }
  manacher.init(str);
  manacher.manacher();
  register long long ans = 1;
  f[0] = 1;
  for (register int i = 1; i < n; i++) {
    if (manacher.judge(i))
      f[i] = f[(i - 1) >> 1] + 1;
    else
      f[i] = 0;
    ans += f[i];
  }
  printOut(ans);
}
int main() {
  run();
  return 0;
}
