#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
using namespace std::chrono;
using ll = long long;
using pll = pair<ll, ll>;
const int MAX_N = 5e6 + 5;
const ll P1 = 1e9 + 7;
const ll X = 67;
int n;
char Str[MAX_N];
int dp[MAX_N] = {0};
ll Pref[MAX_N], InvPref[MAX_N];
ll BasePow[MAX_N];
ll getCharValue(char c) {
  if (isdigit(c)) {
    return 1 + c - '0';
  } else {
    if (islower(c)) {
      return 11 + c - 'a';
    } else {
      return 37 + c - 'A';
    }
  }
}
ll getHash(int l, int r) {
  if (l == 0) return Pref[r];
  return (Pref[r] - (Pref[l - 1] * BasePow[r - l + 1]) % P1 + P1) % P1;
}
void fillBasePow() {
  BasePow[0] = 1;
  for (int i = 1; i <= n; i++) {
    BasePow[i] = BasePow[i - 1] * X;
    BasePow[i] %= P1;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  auto start = system_clock::now();
  auto end = system_clock::now();
  scanf("%s", &Str);
  end = system_clock::now();
  cerr << "Read string time: "
       << duration_cast<std::chrono::milliseconds>(end - start).count()
       << "ms\n";
  for (n = 0; Str[n] != '\0'; n++)
    ;
  fillBasePow();
  ll hash = 0LL;
  ll invHash = 0LL;
  for (int i = 0; i < n; i++) {
    ll c = getCharValue(Str[i]);
    hash *= X;
    hash %= P1;
    hash += c;
    hash %= P1;
    Pref[i] = hash;
    invHash += (BasePow[i] * c) % P1;
    invHash %= P1;
    InvPref[i] = invHash;
    if (i % 2 == 0) {
      int mid = i / 2;
      if (InvPref[mid - 1] == getHash(mid + 1, i)) {
        dp[i] = dp[mid - 1] + 1;
      }
    } else {
      if (InvPref[i / 2] == getHash(i / 2 + 1, i)) {
        dp[i] = dp[i / 2] + 1;
      }
    }
  }
  end = system_clock::now();
  cerr << "Finished hashing shinanigens time: "
       << duration_cast<std::chrono::milliseconds>(end - start).count()
       << "ms\n";
  ll ans = accumulate(dp, dp + n, 0LL);
  printf("%lld\n", ans);
  end = system_clock::now();
  cerr << "Execution time: "
       << duration_cast<std::chrono::milliseconds>(end - start).count()
       << "ms\n";
  return 0;
}
