#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long long exp(long long a, long long b, long long m) {
  if (b == 0LL) return 1LL;
  if (b == 1LL) return mod(a, m);
  long long k = mod(exp(a, b / 2, m), m);
  if (b & 1LL) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string s;
  cin >> s;
  int n = s.size();
  vector<int> d1(n), d2(n), res(n);
  for (int i = 0, l = 0, r = -1; i < n; i++) {
    int k = (i > r) ? 1 : min(d1[l + r - i], r - i + 1);
    while (0 <= i - k && i + k < n && s[i - k] == s[i + k]) {
      k++;
    }
    d1[i] = k--;
    if (i + k > r) {
      l = i - k;
      r = i + k;
    }
  }
  for (int i = 0, l = 0, r = -1; i < n; i++) {
    int k = (i > r) ? 0 : min(d2[l + r - i + 1], r - i + 1);
    while (0 <= i - k - 1 && i + k < n && s[i - k - 1] == s[i + k]) {
      k++;
    }
    d2[i] = k--;
    if (i + k > r) {
      r = i + k;
      l = i - k - 1;
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (i & 1) {
      int c = (i + 1) / 2;
      int t = d2[c];
      if (2 * t == i + 1) {
        res[i] = 1 + res[c - 1];
      } else
        res[i] = 0;
    } else {
      int c = i / 2;
      int t = d1[c];
      if (2 * t - 1 == i + 1) {
        res[i] = 1 + (c == 0 ? 0 : res[c - 1]);
      } else
        res[i] = 0;
    }
    ans += res[i];
  }
  cout << ans << "\n";
}
