#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  int n = s.size();
  long long StepB = 1;
  vector<long long> Hashes(n);
  vector<long long> Revhashes(n);
  Hashes[0] = s[0];
  Revhashes[0] = s[0];
  for (int i = 1; i < n; i++) {
    Hashes[i] = (((Hashes[i - 1] * 137) % 1000000007) + s[i]) % 1000000007;
    StepB = (StepB * 137) % 1000000007;
    Revhashes[i] =
        ((s[i] * StepB) % 1000000007 + Revhashes[i - 1]) % 1000000007;
  }
  vector<int> Ks(n + 1, 0);
  for (int i = 1; i <= n; i++) {
    if (Hashes[i - 1] == Revhashes[i - 1]) {
      Ks[i] = Ks[i / 2] + 1;
    } else
      Ks[i] = 0;
  }
  int rez = 0;
  for (int i = 0; i <= n; i++) {
    rez += Ks[i];
  }
  cout << rez << endl;
}
