#include <bits/stdc++.h>
using namespace std;
unsigned long long del;
char s[5000001];
unsigned long long dp[5000001];
int main() {
  int i;
  unsigned long long l, r, mark, sum;
  while (scanf("%s", s + 1) != EOF) {
    dp[0] = 0;
    sum = 0;
    l = r = 0;
    del = 1;
    mark = 129;
    for (i = 1; s[i]; i++) {
      l = l * mark + s[i];
      r = r + s[i] * del;
      del *= mark;
      if (l == r) {
        dp[i] = dp[i >> 1] + 1;
        sum += dp[i];
      }
    }
    cout << sum << endl;
  }
  return 0;
}
