#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 10;
const long long int INF = 2e18 + 10;
const int Mod = 1e9 + 7;
const int MAXN = 5e6 + 10;
const int N = 2e3 + 10;
const int M = 1e3 + 10;
int l, r, p = 131, q = 1, ans, h[MAXN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  for (int i = 0; i < n; i++) {
    l = l * p + s[i];
    r = r + s[i] * q;
    q *= p;
    if (l == r) {
      h[i + 1] = 1 + h[(i + 1) / 2];
      ans += h[i + 1];
    }
  }
  cout << ans << endl;
  return 0;
}
