#include <bits/stdc++.h>
using namespace std;
constexpr long long MX = 5000000;
long long base = 129;
long long mod = 1479386893;
long long powBase[MX + 5];
void ctPow() {
  powBase[0] = 1;
  for (long long i = 1; i <= MX; i++) {
    powBase[i] = (powBase[i - 1] * base) % mod;
  }
}
long long palPre[MX + 5];
void getHash(string s) {
  long long len = s.size();
  long long hsh = 0, revHsh = 0;
  for (long long i = 0; i < len; i++) {
    hsh = ((hsh * base) % mod + (s[i] - '0' + 1)) % mod;
    revHsh = (revHsh + ((s[i] - '0' + 1) * powBase[i]) % mod) % mod;
    ;
    if (hsh == revHsh)
      palPre[i] = 1;
    else
      palPre[i] = 0;
  }
}
long long solve(string s) {
  getHash(s);
  long long len = s.size();
  for (long long i = 1; i < len; i++) {
    if (palPre[i] != 0) {
      palPre[i] += palPre[(i - 1) / 2];
    }
  }
  long long sum = 0;
  for (long long i = 0; i < len; i++) sum += palPre[i];
  return sum;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ctPow();
  string s;
  cin >> s;
  long long ans = solve(s);
  cout << ans << "\n";
  return 0;
}
