#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5 * 1000001;
const unsigned long long T = 257;
char s[MAXN];
int n, f[MAXN], i, ans;
unsigned long long h[MAXN], revH[MAXN], t[MAXN];
void calcT(int n) {
  t[0] = 1;
  for (int i = 1; i <= n; i++) t[i] = t[i - 1] * T;
}
void calcH(char* s, int n) {
  h[0] = 0;
  for (int i = 1; i <= n; i++) {
    h[i] = h[i - 1] + s[i - 1] * t[i - 1];
  }
}
unsigned long long getH(int l, int r) {
  return t[n - l + 1] * (h[r] - h[l - 1]);
}
void calcRevH(char* s, int n) {
  h[n + 1] = 0;
  for (int i = n; i >= 1; i--) {
    revH[i] = revH[i + 1] + s[i - 1] * t[n - i];
  }
}
unsigned long long getRevH(int l, int r) {
  return t[r] * (revH[l] - revH[r + 1]);
}
int main() {
  gets(s);
  n = strlen(s);
  calcT(n);
  calcH(s, n);
  calcRevH(s, n);
  f[1] = 1;
  for (i = 2; i <= n; i++) {
    int l, r, ll, rr;
    int m = i / 2;
    l = 1, r = m;
    rr = i;
    if (i % 2 == 1)
      ll = m + 2;
    else
      ll = m + 1;
    if (getH(l, r) == getRevH(ll, rr))
      f[i] = f[m] + 1;
    else
      f[i] = 0;
  }
  for (i = 1; i <= n; i++) {
    ans += f[i];
  }
  printf("%d", ans);
}
