#include <bits/stdc++.h>
using namespace std;
inline long long f(char c) {
  if (isdigit(c)) return c - '0' + 1;
  if (islower(c)) return c - 'a' + 11;
  return c - 'A' + 37;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  s = '#' + s;
  long long n = s.size() - 1;
  long long e[n + 2];
  e[0] = 1;
  long long P = 67;
  for (long long i = 1; i < n + 2; ++i) e[i] = e[i - 1] * P;
  long long p[n + 1];
  p[0] = 0;
  for (long long i = 1; i <= n; ++i) p[i] = (p[i - 1] + f(s[i]) * e[i]);
  long long q[n + 2];
  q[n + 1] = 0;
  for (long long i = n; i >= 1; --i) q[i] = (q[i + 1] + f(s[i]) * e[n + 1 - i]);
  long long d[n + 1];
  d[0] = 0;
  for (long long i = 1; i <= n; ++i) {
    if (p[i / 2] * e[n - i] - (q[(i + 3) / 2] - q[i + 1]))
      d[i] = 0;
    else
      d[i] = d[i / 2] + 1;
  }
  long long ans = accumulate(d + 1, d + n + 1, 0LL);
  cout << ans << '\n';
}
