#include <bits/stdc++.h>
using namespace std;
const long long maxn = 5e6 + 2;
const long long INF = 1e9;
const int M = 1e9 + 7;
const int b = 727;
int n, q, ans, a[maxn], h[maxn], hr[maxn], dp[maxn];
string s, k;
int get(int l, int r) {
  return (hr[r] - (long long)hr[l] * a[r - l] % M + M) % M;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> s;
  k = s;
  reverse(k.begin(), k.end());
  a[0] = 1;
  n = s.size();
  for (int i = 1; i <= n; i++) a[i] = (long long)a[i - 1] * b % M;
  for (int i = 1; i <= n; i++) {
    h[i] = ((long long)h[i - 1] * b + s[i - 1]) % M;
    hr[i] = ((long long)hr[i - 1] * b + k[i - 1]) % M;
  }
  dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (h[i] == get(n - i, n)) dp[i] = dp[i / 2] + 1;
    ans += dp[i];
  }
  cout << ans + 1;
  return 0;
}
