#include <bits/stdc++.h>
using namespace std;
const int maxn = 5000000 + 10;
const int x = 123;
unsigned long long H[maxn], xp[maxn], H2[maxn];
char s[maxn];
int n, m, pos;
int sum = 0;
int dep[maxn];
bool isok(int i, int len) {
  unsigned long long a = H[i] - H[i + len] * xp[len];
  unsigned long long b;
  if (i == 0)
    b = H2[i + len - 1];
  else
    b = H2[i + len - 1] - H2[i - 1] * xp[len];
  return a == b;
}
int solve(int e) {
  if (e == 0) return 0;
  if (!isok(0, e)) return 0;
  int cur = solve(e / 2) + 1;
  sum = max(sum, cur);
  return cur;
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  H[n] = 0;
  for (int i = n - 1; i >= 0; i--) H[i] = H[i + 1] * x + s[i];
  H2[0] = s[0];
  for (int i = 1; i < n; i++) H2[i] = H2[i - 1] * x + s[i];
  xp[0] = 1;
  for (int i = 1; i <= n; i++) xp[i] = xp[i - 1] * x;
  int ans = 0;
  memset(dep, 0, sizeof dep);
  for (int i = 0; i < n; i++) {
    sum = 0;
    if (isok(0, i + 1)) {
      if (isok(0, (i + 1) / 2))
        dep[i + 1] = dep[(i + 1) / 2] + 1;
      else {
        sum = 0;
        solve(i + 1);
        dep[i + 1] = sum;
      }
      ans += dep[i + 1];
    }
  }
  printf("%d\n", ans);
  return 0;
}
