#include <bits/stdc++.h>
using namespace std;
char s[5000010];
long long p[5000010];
string st;
int main() {
  scanf("%s", s);
  st = s;
  long long cnt = p[0] = 1;
  long long h1, h2, g1, g2, po1, po2;
  po2 = po1 = 1;
  g1 = h1 = s[0];
  g2 = h2 = s[0];
  p[0] = 1;
  for (long long i = 1; i < st.size(); i++) {
    po1 = po1 * 313LL % 1057489703LL;
    g1 = (g1 + s[i] * po1 % 1057489703LL) % 1057489703LL;
    h1 = h1 * 313LL % 1057489703LL;
    h1 = (h1 + s[i]) % 1057489703LL;
    po2 = po2 * 311LL % 1057481927LL;
    g2 = (g2 + s[i] * po2 % 1057481927LL) % 1057481927LL;
    h2 = h2 * 311LL % 1057481927LL;
    h2 = (h2 + s[i]) % 1057481927LL;
    if (g1 == h1 && g2 == h2) {
      p[i] = p[(i - 1) >> 1] + 1;
      cnt += p[i];
    }
  }
  cout << cnt << '\n';
  return 0;
}
