#include <bits/stdc++.h>
using namespace std;
const long long N = 5e6 + 10, NM = 1 << 16, MOD = 1e9 + 7, INF = 1e15 + 10,
                SQ = 640, LOG = 20, BH = 723, BH2 = 87651, MH = 1610612741,
                MH2 = 924467661;
int n, m, x1, x2, z, x, y, y2, t, maxi, ans, mini, ptr, k, p, pos, posi, l, r,
    pw[2][N], hshl[2][N], hshr[2][N], dp[N];
string s;
pair<int, int> hsh(int l, int r, int q, int mod) {
  long long tmp1 = hshl[q][r];
  if (l) {
    tmp1 -= (1ll * hshl[q][l - 1] * pw[q][r - l + 1]) % mod;
    if (tmp1 < 0) tmp1 += mod;
    if (tmp1 >= mod) tmp1 %= mod;
  }
  long long tmp2 = hshr[q][l];
  if (r != n - 1) {
    tmp2 -= (1ll * hshr[q][r + 1] * pw[q][r - l + 1]) % mod;
    if (tmp2 < 0) tmp2 += mod;
    if (tmp2 >= mod) tmp2 %= mod;
  }
  return {tmp1, tmp2};
}
int hsh2(int l, int r, int q, int mod) {
  long long tmp1 = hshl[q][r];
  if (l) {
    tmp1 -= (1ll * hshl[q][l - 1] * pw[q][r - l + 1]) % mod;
    if (tmp1 < 0) tmp1 += mod;
    if (tmp1 >= mod) tmp1 %= mod;
  }
  return tmp1;
}
void prehash(int base, int mod, int q) {
  pw[q][0] = 1;
  for (int i = 1; i < N; i++) {
    pw[q][i] = (1ll * pw[q][i - 1] * base) % mod;
    if (pw[q][i] >= mod) pw[q][i] %= mod;
  }
  for (int i = 0; i < n; i++) {
    if (i) {
      hshl[q][i] = (1ll * hshl[q][i - 1] * base) % mod;
      if (hshl[q][i] >= mod) hshl[q][i] %= mod;
    }
    hshl[q][i] += s[i];
    if (hshl[q][i] >= mod) hshl[q][i] %= mod;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (i != n - 1) {
      hshr[q][i] = (1ll * hshr[q][i + 1] * base) % mod;
      if (hshr[q][i] >= mod) hshr[q][i] %= mod;
    }
    hshr[q][i] += s[i];
    if (hshr[q][i] >= mod) hshr[q][i] %= mod;
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> s;
  n = s.size();
  prehash(BH, MH, 0);
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      dp[i] = 1;
      ans++;
      continue;
    }
    int mid = i / 2;
    if (i % 2 == 0) mid--;
    int mid1 = i / 2;
    if (i % 2 == 0) {
      mid1++;
    } else {
      mid1++;
    }
    pair<int, int> kk = hsh(0, i, 0, MH);
    if (kk.first == kk.second) dp[i] = 1;
    if (dp[i] && (hsh2(0, mid, 0, MH) == hsh2(mid1, i, 0, MH))) {
      dp[i] += dp[mid];
    }
    ans += dp[i];
  }
  cout << ans;
}
