#include <bits/stdc++.h>
using namespace std;
string s;
long long a[5000000 + 5];
long long f, b, p;
int main() {
  cin >> s;
  p = 1, f = b = 0;
  long long ans = 0;
  for (int i = (1), _b = (s.size()); i <= _b; i++) a[i] = 0;
  for (int i = (1), _b = (s.size()); i <= _b; i++) {
    f = f * 13331 + s[i - 1];
    b = s[i - 1] * p + b;
    p *= 13331;
    if (f == b) {
      a[i] = a[i / 2] + 1;
      ans += a[i];
    }
  }
  printf("%d", ans);
  return 0;
}
