#include <bits/stdc++.h>
using namespace std;
const int base = 727, md = 1e9 + 7;
string s;
long long pwr[5555555], prehs[5555555], sufhs[5555555], dp[5555555], ans = 1;
inline bool pal(int i) {
  return (prehs[i] == (sufhs[0] - (sufhs[i + 1] * pwr[i + 1] % md) + md) % md);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  int n = s.size();
  pwr[0] = 1;
  for (int i = 1; i <= n; i++) pwr[i] = (pwr[i - 1] * base) % md;
  prehs[0] = s[0];
  for (int i = 1; i < n; i++) {
    prehs[i] = (prehs[i - 1] * base + s[i]) % md;
  }
  for (int i = n - 1; i >= 0; i--) {
    sufhs[i] = (sufhs[i + 1] * base + s[i]) % md;
  }
  dp[0] = 1;
  for (int i = 1; i < n; i++) {
    if (pal(i)) {
      dp[i] = dp[(i - 1) / 2] + 1;
    }
    ans += dp[i];
  }
  cout << ans << endl;
  return 0;
}
