#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
template <class T>
int size(const T &x) {
  return x.size();
}
const int N = 5000100;
int deg[N];
char s[N];
int base = 251;
int mod = 1000000007;
int main() {
  scanf("%s", s);
  int n = strlen(s);
  deg[0] = 1;
  long long res = 1;
  int left = s[0], right = s[0];
  int p = 1;
  for (int i = 2; i <= n; i++) {
    deg[i - 1] = 0;
    left = ((long long)left * base + s[i - 1]) % mod;
    p = ((long long)p * base) % mod;
    right = (right + (long long)p * s[i - 1]) % mod;
    if (left == right) {
      deg[i - 1] = deg[i / 2 - 1] + 1;
    }
    res += deg[i - 1];
  }
  cout << res << endl;
  return 0;
}
