#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e6 + 5;
int dp[maxn];
int Len[maxn * 2];
char s[maxn];
char d[maxn * 2];
void init() {
  int slen = strlen(s);
  int j = 0;
  d[j++] = '$';
  d[j++] = '#';
  for (int i = 0; i < slen; ++i) {
    d[j++] = s[i];
    d[j++] = '#';
  }
}
void manacher() {
  int dlen = strlen(d);
  int p = 0, p0 = 0;
  for (int i = 1; i < dlen; ++i) {
    if (p > i)
      Len[i] = min(p - i, Len[2 * p0 - i]);
    else
      Len[i] = 1;
    while (d[i + Len[i]] == d[i - Len[i]]) ++Len[i];
    if (i + Len[i] > p) {
      p = i + Len[i];
      p0 = i;
    }
  }
}
void solve() {
  init();
  manacher();
  int slen = strlen(s);
  int ans = 1;
  dp[1] = 1;
  for (int i = 2; i < slen + 1; ++i) {
    if (Len[i + 1] >= i + 1) {
      dp[i] = dp[i >> 1] + 1;
    }
    ans += dp[i];
  }
  printf("%d\n", ans);
}
int main() {
  scanf("%s", s);
  solve();
  return 0;
}
