#include <bits/stdc++.h>
using namespace std;
const int N = 5e6 + 5, mod = 1e9 + 7, pr = 31, mod2 = 1e9 + 9, pr2 = 53;
int dp[N];
pair<int, int> inv[N], a[N], b[N];
string s;
int fp(int a, int p, int m) {
  if (!p) return 1;
  int t = fp(a, p >> 1, m);
  t = (t * 1ll * t) % m;
  if (p & 1) t = (t * 1ll * a) % m;
  return t;
}
int n;
pair<int, int> get(int i, int j) {
  pair<int, int> t;
  t.first = (b[j].first - b[i + 1].first + mod) % mod;
  t.first = (t.first * 1ll * inv[n - i + 1].first) % mod;
  t.second = (b[j].second - b[i + 1].second + mod2) % mod2;
  t.second = (t.second * 1ll * inv[n - i + 1].second) % mod2;
  return t;
}
int get(char x) {
  if (x >= 'a' && x <= 'z') return x - 'a' + 1;
  if (x >= '0' && x <= '9') return x - '0' + 27;
  return x - 'A' + 38;
}
int pw[N], pw2[N], S[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  n = s.size();
  pw[0] = pw2[0] = 1;
  for (int i = 1; i < n; i++) {
    pw[i] = (pw[i - 1] * 1ll * pr) % mod;
    pw2[i] = (pw2[i - 1] * 1ll * pr2) % mod2;
  }
  inv[n].first = fp(pw[n - 1], mod - 2, mod);
  inv[n].second = fp(pw2[n - 1], mod2 - 2, mod2);
  for (int i = n - 1; i >= 0; i--) {
    inv[i].first = (inv[i + 1].first * 1ll * pw[1]) % mod;
    inv[i].second = (inv[i + 1].second * 1ll * pw2[1]) % mod2;
  }
  for (int i = 1; i <= n; i++) {
    S[i] = get(s[i - 1]);
    a[i].first = (S[i] * 1ll * pw[i - 1]) % mod;
    a[i].second = (S[i] * 1ll * pw2[i - 1]) % mod2;
    a[i].first += a[i - 1].first;
    if (a[i].first >= mod) a[i].first -= mod;
    a[i].second += a[i - 1].second;
    if (a[i].second >= mod2) a[i].second -= mod2;
  }
  for (int i = n, j = 0; i >= 1; i--, j++) {
    b[i].first = (S[i] * 1ll * pw[j]) % mod;
    b[i].second = (S[i] * 1ll * pw2[j]) % mod2;
    b[i].first += b[i + 1].first;
    if (b[i].first >= mod) b[i].first -= mod;
    b[i].second += b[i + 1].second;
    if (b[i].second >= mod2) b[i].second -= mod2;
  }
  long long ans = 1;
  dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (a[i >> 1] == get(i, i - (i >> 1) + 1)) dp[i] = dp[i >> 1] + 1;
    ans += dp[i];
  }
  cout << ans << endl;
  return 0;
}
