#include <bits/stdc++.h>
using namespace std;
long long p = 2127001057;
const int mod = 1e9 + 7;
const int max_n = 5000010;
int a[max_n], b[max_n], dp[max_n];
int main() {
  ios_base::sync_with_stdio(false);
  string str;
  cin >> str;
  long long x = 1;
  for (int i = 1; i <= str.length(); i++)
    a[i] = (a[i - 1] + x * str[i - 1]) % mod, x = (x * p) % mod;
  for (int i = 1; i <= str.length(); i++)
    b[i] = (b[i - 1] * p + str[i - 1]) % mod;
  int ans = 0;
  for (int i = 1; i <= str.length(); i++)
    if (b[i] == a[i]) dp[i] = dp[i / 2] + 1, ans += dp[i];
  cout << ans << endl;
  return 0;
}
