#include <bits/stdc++.h>
using namespace std;
const int N = 5e6 + 1;
unsigned long long hash1[N], hash2[N], p[N];
int base = 133331, dp[N], n, ans;
char s[N], ss[N];
inline unsigned long long get(int l, int r) {
  return hash1[r] - hash1[l - 1] * p[r - l + 1];
}
inline unsigned long long getre(int l, int r) {
  return hash2[r] - hash2[l - 1] * p[r - l + 1];
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n; i++) ss[i] = s[n - i + 1];
  p[0] = 1;
  for (int i = 1; i <= n; i++) {
    hash1[i] = hash1[i - 1] * base + int(s[i]);
    p[i] = p[i - 1] * base;
  }
  for (int i = 1; i <= n; i++) hash2[i] = hash2[i - 1] * base + int(ss[i]);
  for (int i = 1; i <= n; i++) {
    unsigned long long right = get(1, i / 2),
                       left = getre(n - i + 1, n - i + i / 2);
    if (right == left) dp[i] = dp[i / 2] + 1;
    ans += dp[i];
  }
  return cout << ans, 0;
}
