#include <bits/stdc++.h>
using namespace std;
const int mx = 5e6 + 10;
long long Hash[mx];
int mod = 3;
char s[mx];
int main() {
  gets(s);
  int p = 1, a = 0, b = 0, ans = 0;
  for (int i = 0; s[i]; i++) {
    a = a * mod + s[i];
    b += s[i] * p;
    p *= mod;
    if (a == b) {
      Hash[i + 1] = Hash[(i + 1) >> 1] + 1;
      ans += Hash[i + 1];
    } else
      Hash[i + 1] = 0;
  }
  cout << ans << endl;
}
