#include <bits/stdc++.h>
namespace solution {
class ISolution {
 public:
  virtual void init(){};
  virtual bool input() { return false; };
  virtual void output(){};
  virtual int run() = 0;
};
}  // namespace solution
namespace hash {
namespace rolling_hash {
template <class T>
class IRollingHash {
 public:
  virtual void init(){};
  virtual void pushBack(int c){};
  virtual void popBack(){};
  virtual void pushFront(int c){};
  virtual void popFront(){};
  virtual T getHash() = 0;
};
}  // namespace rolling_hash
}  // namespace hash
namespace math {
template <class T>
T extgcd(T a, T b, T& x, T& y) {
  for (T u = y = 1, v = x = 0; a;) {
    T q = b / a;
    std::swap(x -= q * u, u);
    std::swap(y -= q * v, v);
    std::swap(b -= q * a, a);
  }
  return b;
}
}  // namespace math
namespace math {
template <class T>
T mod_inverse(T a, T m) {
  T x, y;
  extgcd(a, m, x, y);
  x %= m;
  while (x < 0) x += m;
  return x;
}
}  // namespace math
namespace hash {
namespace rolling_hash {
class RollingHash {
 public:
  unsigned long long B, hash, bases;
  RollingHash(unsigned long long B) : B(B) { init(); }
  void init() { hash = 0, bases = 1; }
  void pushBack(int c) { hash = hash * B + c, bases = bases * B; }
};
}  // namespace rolling_hash
}  // namespace hash
namespace solution {
using namespace std;
using namespace hash::rolling_hash;
const int SIZE = 5000011;
const unsigned long long BASE = 263LL;
unsigned long long dp[SIZE];
class Solution : public ISolution {
 public:
  string s;
  int n;
  void init() { fill(dp, dp + SIZE, 0); }
  bool input() {
    if (!(cin >> s)) return false;
    n = s.size();
    return true;
  }
  vector<unsigned long long> calc_hash_prefix() {
    int n = s.size();
    RollingHash rh(BASE);
    vector<unsigned long long> res(n + 1, 0);
    for (int i = 0; i < n; ++i) {
      rh.pushBack(s[i]);
      res[i + 1] = rh.hash;
    }
    return res;
  }
  vector<unsigned long long> calc_hash_suffix() {
    int n = s.size();
    RollingHash rh(BASE);
    vector<unsigned long long> res(n + 1, 0);
    for (int i = 0; i < n; ++i) {
      rh.pushBack(s[n - i - 1]);
      res[i + 1] = rh.hash;
    }
    return res;
  }
  vector<unsigned long long> calc_bases() {
    vector<unsigned long long> res(SIZE);
    res[0] = 1;
    for (int i = 1; i < SIZE; ++i) res[i] = res[i - 1] * BASE;
    return res;
  }
  unsigned long long solve() {
    vector<unsigned long long> HP = calc_hash_prefix();
    vector<unsigned long long> HS = calc_hash_suffix();
    vector<unsigned long long> B = calc_bases();
    unsigned long long res = 0;
    dp[0] = 0;
    for (int i = 1; i <= n; ++i) {
      int len = i / 2;
      int rlen = i - len;
      if (HP[len] != HS[n - rlen] - HS[n - rlen - len] * B[len]) {
        dp[i] = 0;
        continue;
      }
      dp[i] = dp[len] + 1;
      res += dp[i];
    }
    return res;
  }
  void output(unsigned long long result) { cout << result << endl; }
  int run() {
    while (init(), input()) {
      output(solve());
    }
    return 0;
  }
};
}  // namespace solution
int main() { return solution::Solution().run(); }
