#include <bits/stdc++.h>
using namespace std;
const int n = 6000000, x = 103;
char str[n];
int arr[n];
int main() {
  int i = 0, l = 0, r = 0, t = 1, ans = 0;
  for (gets(str); str[i]; i++) {
    l = l * x + str[i];
    r = r + str[i] * t;
    t = t * x;
    arr[i + 1] = (l == r) ? arr[(i + 1) / 2] + 1 : 0;
    ans = ans + arr[i + 1];
  }
  cout << ans << endl;
}
