#include <bits/stdc++.h>
using namespace std;
int ans = 0;
int i, j, n, m, k, z, x, y, t;
int a[5111111], p[111111], b[111111];
pair<int, int> d[111111];
string st, s;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> s;
  m = 1;
  for (i = 1; i <= (int)s.size(); i++) {
    x = x * 337 + s[i - 1];
    y += m * s[i - 1];
    m *= 337;
    if (x == y) {
      a[i] = a[i / 2] + 1;
      ans += a[i];
    }
  }
  cout << ans;
}
