#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int N = int(5e6) + 10, p = 1201, MOD = int(1e9) + 7;
string s;
int a[N];
long long int DP[N], L[N], R[N];
void build_hash() {
  int len = (int)(s.size());
  for (int i = 0; i < len; i++) {
    a[i] = s[i] - '.';
  }
  long long int temp = 1;
  for (int i = 1; i <= len; i++) {
    L[i] = (L[i - 1] + a[i - 1] * temp) % MOD;
    temp = (temp * p) % MOD;
  }
  for (int i = 1; i <= len; i++) {
    R[i] = (R[i - 1] * p + a[i - 1]) % MOD;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> s;
  long long int ans = 0;
  build_hash();
  for (int i = (int)1; i < (int)(int)(s.size()) + 1; i++) {
    if (L[i] == R[i]) {
      DP[i] = DP[i >> 1] + 1;
      ans += DP[i];
    }
  }
  cout << ans << endl;
  return 0;
}
