#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  getline(cin, s);
  int n = s.size();
  if (n < 2) {
    cout << n << endl;
    return 0;
  }
  vector<int> dp(n + 1, 0);
  dp[1] = 1;
  int res = 1;
  n = 2 * n + 1;
  vector<int> L(n / 2 + 1, 0);
  L[1] = 1;
  int C = 1, R = 2;
  for (int i = 2; i <= n / 2; i++) {
    int j = 2 * C - i;
    if (R - i > 0) L[i] = min(L[j], R - i);
    while (i + L[i] < n && i - L[i] > 0 &&
           ((i + L[i]) % 2 == 1 ||
            s[(i + L[i] + 1) / 2] == s[(i - L[i] - 1) / 2])) {
      L[i]++;
    }
    if (i + L[i] > R) {
      C = i;
      R = i + L[i];
    }
    if (L[i] == i) {
      dp[i] = dp[i / 2] + 1;
      res += dp[i];
    }
  }
  cout << res << endl;
  return 0;
}
