#include <bits/stdc++.h>
using namespace std;
char s[5000010];
int pw[5000010] = {1}, h1[5000010], h2[5000010], dp[5000010];
int main() {
  int n = strlen(gets(s + 1));
  for (int i = 1; i <= n; i++) pw[i] = pw[i - 1] * 131;
  for (int i = 1; i <= n; i++) h1[i] = h1[i - 1] * 131 + s[i];
  for (int i = 1; i <= n; i++) h2[i] = h2[i - 1] + s[i] * pw[i - 1];
  for (int i = 1; i <= n; i++)
    if (h1[i] == h2[i]) dp[i] = dp[i / 2] + 1;
  int ans = 0;
  for (int i = 1; i <= n; i++) ans += dp[i];
  printf("%d\n", ans);
  return 0;
}
