#include <bits/stdc++.h>
using namespace std;
const int N = 6000006;
unsigned long long hs = 3797;
unsigned long long F[N];
int madeF = 0;
void makeF() {
  F[0] = 1;
  for (int i = 1; i < N; i++) F[i] = F[i - 1] * hs;
  madeF = 1;
}
vector<unsigned long long> stringhash(string s) {
  if (madeF == 0) makeF();
  s = '#' + s;
  vector<unsigned long long> H(s.size());
  H[0] = 0;
  for (int i = 1; i < H.size(); i++) H[i] = H[i - 1] * hs + s[i];
  return H;
}
unsigned long long subhash(vector<unsigned long long>& H, int x, int y) {
  if (y < x) swap(x, y);
  return H[y] - F[y - x + 1] * H[x - 1];
}
long long ans[6000006];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  string s;
  cin >> s;
  vector<unsigned long long> v = stringhash(s);
  reverse(s.begin(), s.end());
  vector<unsigned long long> vrev = stringhash(s);
  ans[1] = 1;
  long long sum = 1;
  long long sz;
  long long hf;
  long long n = vrev.size();
  for (int i = 2; i < v.size(); i++) {
    sz = i;
    hf = sz / 2;
    if (sz % 2 == 0) {
      if (subhash(v, 1, hf) == subhash(vrev, n - (hf + 1), n - i)) {
        ans[i] = ans[hf] + 1;
        sum += ans[i];
      }
    } else {
      if (subhash(v, 1, hf) == subhash(vrev, n - (hf + 2), n - i)) {
        ans[i] = ans[hf] + 1;
        sum += ans[i];
      }
    }
  }
  cout << sum;
}
