#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const int N = 5e6 + 10;
char str[N];
int deg[N];
int main() {
  long long p = 0;
  long long q = 0;
  long long m = 1239;
  long long a = 1;
  scanf("%s", str + 1);
  int ans = 0;
  for (int i = 1; str[i]; i++) {
    p = (p * m + str[i]);
    q = (q + str[i] * a);
    a = a * m;
    if (p == q) {
      deg[i] = deg[i >> 1] + 1;
      ans += deg[i];
    }
  }
  printf("%d\n", ans);
  return 0;
}
