#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7;
long long f(char x) {
  if ('0' <= x && x <= '9') {
    return x - '0' + 1;
  } else {
    if ('a' <= x && x <= 'z') {
      return x - 'a' + 11;
    } else {
      return x - 'A' + 11 + ('z' - 'a' + 1);
    }
  }
}
long long deg[(int)5e6 + 10], pre_hashes[(int)5e6], suf_hashes[(int)5e6];
long long ans[(int)5e6];
int main() {
  string s;
  cin >> s;
  deg[0] = 1;
  for (int i = 1; i < (int)5e6 + 10; ++i) {
    deg[i] = (deg[i - 1] * 67) % M;
  }
  pre_hashes[0] = f(s[0]);
  for (int i = 1; i < (s).size(); ++i) {
    pre_hashes[i] = (pre_hashes[i - 1] + f(s[i]) * deg[i]) % M;
  }
  reverse((s).begin(), (s).end());
  suf_hashes[0] = f(s[0]);
  for (int i = 1; i < (s).size(); ++i) {
    suf_hashes[i] = (suf_hashes[i - 1] + f(s[i]) * deg[i]) % M;
  }
  memset((ans), (0), sizeof(ans));
  long long r = 1;
  ans[0] = 1;
  for (int i = 1; i < (s).size(); ++i) {
    if ((deg[(s).size() - i - 1] * pre_hashes[(i - 1) / 2]) % M ==
        (suf_hashes[(s).size() - 1 - (i - (i - 1) / 2)] -
         suf_hashes[(s).size() - 2 - i] + M) %
            M) {
      ans[i] = ans[(i - 1) / 2] + 1;
    } else {
      ans[i] = 0;
    }
    r += ans[i];
  }
  cout << r;
  return 0;
}
