#include <bits/stdc++.h>
using namespace std;
const int mx = 5e6 + 1, Base = 256, Mod = 1e9 + 7;
char s[mx];
long long int n, f[mx], ans[mx], res;
long long int ph[mx], sh[mx], Bpow[mx];
int main() {
  scanf("%s", s);
  n = strlen(s);
  Bpow[0] = 1;
  for (int i = 1; i <= n; i++) Bpow[i] = (Bpow[i - 1] * Base) % Mod;
  ph[0] = s[0];
  for (int i = 1; i < n; i++) ph[i] = (ph[i - 1] * Base + s[i]) % Mod;
  sh[n - 1] = s[n - 1];
  for (int i = n - 2; i >= 0; i--) sh[i] = (sh[i + 1] * Base + s[i]) % Mod;
  for (int i = 0; i < n; i++) {
    if ((ph[i] == (sh[0] - ((sh[i + 1] * Bpow[i + 1]) % Mod) + Mod) % Mod) ||
        (i == n - 1 && ph[i] == sh[0])) {
      ans[i] = ans[(i + 1) / 2 - 1] + 1;
      res += ans[i];
    }
  }
  cout << res << '\n';
  return 0;
}
