#include <bits/stdc++.h>
using namespace std;
long long ans[5000010] = {0};
int main() {
  cin.sync_with_stdio(0);
  string s;
  cin >> s;
  int len = s.length();
  ans[1] = 1;
  long long sm = 1;
  long long base = 37;
  long long pbase = 37;
  long long h1 = s[0] - 'A' + 1;
  long long h2 = s[0] - 'A' + 1;
  for (long long i = 2; i <= len; i++) {
    h1 = h1 * base + (s[i - 1] - 'A' + 1);
    h2 = h2 + (s[i - 1] - 'A' + 1) * pbase;
    pbase *= base;
    if (h1 == h2) {
      ans[i] = ans[i / 2] + 1;
      sm += ans[i];
    }
  }
  cout << sm;
  return 0;
}
