#include <bits/stdc++.h>
using namespace std;
int com[5000001];
int main() {
  string s;
  cin >> s;
  unsigned long long p = 1;
  unsigned long long res = 0, h1 = 0, h2 = 0;
  for (int i = 0; i < s.size(); i++) {
    h1 = h1 * ((int)257) + s[i];
    h2 = h2 + p * s[i];
    int tem = 0;
    if (h1 == h2) tem = com[(i + 1) / 2] + 1;
    res += tem;
    p *= ((int)257);
    if (i + 1 < s.size()) com[i + 1] = tem;
  }
  cout << res << endl;
  return 0;
}
