#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
struct Hash {
  long long SEED = 1331;
  long long MOD = 1000000007;
  vector<long long> ha;
  vector<long long> power;
  Hash(string x) {
    ha = vector<long long>(x.size());
    power = vector<long long>(x.size());
    build(x);
  }
  void build(string x) {
    power[0] = 1;
    for (int i = 1; i < (int)power.size(); i++)
      power[i] = (power[i - 1] * SEED) % MOD;
    ha[0] = x[0];
    for (int i = 1; i < (int)ha.size(); i++)
      ha[i] = (ha[i - 1] * SEED + x[i]) % MOD;
  }
  long long get(int i, int j) {
    long long ret = ha[j];
    if (i) ret -= ha[i - 1] * power[j - i + 1];
    ret = (ret % MOD + MOD) % MOD;
    return ret;
  }
};
const int N = 5000500;
char r[N];
int Dp[N];
int main() {
  scanf("%s", r);
  string s(r), t(r);
  reverse(t.begin(), t.end());
  Hash Hs(s), Ht(t);
  int n = s.size();
  int Ans = Dp[0] = 1;
  for (int i = 1; i < n; i++) {
    int x1 = Hs.get(0, i);
    int x2 = Ht.get(n - 1 - i, n - 1);
    if (x1 == x2) {
      Dp[i] = 1 + Dp[(i - 1) / 2];
      Ans += Dp[i];
    }
  }
  cout << Ans;
}
