#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 7;
const long double eps = 1e-7;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
int dx[8] = {+1, +1, +1, 0, 0, -1, -1, -1};
int dy[8] = {+1, 0, -1, +1, -1, +1, 0, -1};
long long power(long long x, long long y) {
  long long res = 1;
  x = x;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
template <typename T>
T gcd(T a, T mp) {
  if (a == 0) return mp;
  return gcd(mp % a, a);
}
template <typename T>
T powm(T a, T mp, long long m) {
  T cnt = 1;
  while (mp > 0) {
    if (mp % 2 == 1) cnt = (cnt * a) % m;
    mp /= 2;
    a = (a * a) % m;
  }
  return cnt % m;
}
long long ncr(long long n, long long r) {
  long long res = 1;
  if (r > n) return 0;
  if (r > n - r) r = n - r;
  for (long long i = 0; i < r; i++) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
long long sqr(long long x) { return x * x; }
void prec() {}
struct Hashs {
  vector<int> hashs;
  vector<int> pows;
  int P;
  int MOD;
  Hashs() {}
  Hashs(string &s, int P, int MOD) : P(P), MOD(MOD) {
    int n = s.size();
    pows.resize(n + 1, 0);
    hashs.resize(n + 1, 0);
    pows[0] = 1;
    for (int i = n - 1; i >= 0; i--) {
      hashs[i] = (1LL * hashs[i + 1] * P + s[i] - 'a' + 1) % MOD;
      pows[n - i] = (1LL * pows[n - i - 1] * P) % MOD;
    }
    pows[n] = (1LL * pows[n - 1] * P) % MOD;
  }
  int get_hash(int l, int r) {
    int ans = hashs[l] + MOD - (1LL * hashs[r + 1] * pows[r - l + 1]) % MOD;
    ans %= MOD;
    return ans;
  }
};
Hashs h1, h2;
string s, t;
void run() {
  cin >> s;
  int n = (long long)s.size();
  t = s;
  reverse((t).begin(), (t).end());
  h1 = Hashs(s, 31, 1000000009);
  h2 = Hashs(t, 31, 1000000009);
  long long dp[n + 5];
  dp[0] = 1;
  long long ans = 1;
  for (long long i = (1); i <= (n - 1); ++i) {
    dp[i] = 0;
    if (h1.get_hash(0, i) == h2.get_hash(n - i - 1, n - 1) and (i + 1) & 1)
      dp[i] = dp[i / 2 - 1] + 1;
    else if (h1.get_hash(0, i) == h2.get_hash(n - i - 1, n - 1))
      dp[i] = dp[i / 2] + 1;
    ans += dp[i];
  }
  cout << ans;
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  int tc = 1;
  prec();
  for (long long i = 0; i < tc; ++i) run();
  return 0;
}
