#include <bits/stdc++.h>
int dx[] = {0, 1, -1, 0, 1, -1, 1, -1, -2, 2, 0, 0},
    dy[] = {1, 0, 0, -1, -1, 1, 1, -1, 0, 0, -2, 2};
using namespace std;
const long long B = 3, M = INT_MAX;
int n;
long long I2N[5000006], I20[5000006], modPow[5000006];
int8_t deg0a[5000006];
bool isPalindrome(int l, int r) {
  long long prefix = I2N[r];
  long long suffix = I20[r];
  return prefix == suffix;
}
int8_t deg0(int r) {
  if (r + 1 == 1) return 1;
  int8_t &ret = deg0a[r];
  if (ret != -1) return ret;
  ret = 0;
  if (isPalindrome(0, r))
    ret++;
  else
    return 0;
  ret += deg0((r + 1) / 2 - 1);
  return ret;
}
int degP(int l, int r) {
  int len = r - l + 1;
  if (len == 1) return 1;
  int ret = 0;
  if (isPalindrome(l, r))
    ret++;
  else
    return 0;
  if (len & 1)
    ret += deg0a[len / 2 - 1];
  else
    ret += deg0a[len / 2 - 1];
  return ret;
}
char str[5000006];
int main() {
  ios_base::sync_with_stdio(true);
  modPow[0] = 1;
  memset(deg0a, -1, sizeof(deg0a));
  ;
  scanf("%s", str);
  n = strlen(str);
  I20[0] = str[0];
  I2N[0] = str[0];
  for (int i = 1; i < n; i++) {
    I20[i] = (I20[i - 1] * B + str[i]);
    modPow[i] = (modPow[i - 1] * B);
    I2N[i] = (I2N[i - 1] + str[i] * modPow[i]);
  }
  for (int i = 0; i < n; i++) deg0a[i] = deg0(i);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    sum += degP(0, i);
  }
  cout << sum << endl;
}
