#include <bits/stdc++.h>
using namespace std;
char a[5000005];
unsigned long long hsh1[5000005], hsh2[5000005], P[5000005];
int n, ans, dep[5000005];
unsigned long long hash1(int x, int y) {
  return hsh1[y] - hsh1[x - 1] * P[y - x + 1];
}
unsigned long long hash2(int x, int y) {
  return hsh2[x] - hsh2[y + 1] * P[y - x + 1];
}
int main() {
  scanf("%s", a + 1);
  n = strlen(a + 1);
  P[0] = 1;
  for (int i = 1; i <= n; i++) {
    hsh1[i] = hsh1[i - 1] * 137 + a[i];
    P[i] = P[i - 1] * 137;
  }
  for (int i = n; i; i--) hsh2[i] = hsh2[i + 1] * 137 + a[i];
  ans = dep[1] = 1;
  for (int i = 2; i <= n; i++) {
    int len = i / 2;
    dep[i] = (hash1(1, len) == hash2(i - len + 1, i)) ? dep[len] + 1 : 0;
    ans += dep[i];
  }
  printf("%d\n", ans);
}
