#include <bits/stdc++.h>
using namespace std;
const long long N = 5e6 + 100;
const long long M = 20;
const long long SQ = 320;
const long long INF = 1e16;
const long long MOD = 1e9 + 7;
const long long base = 12347;
const long long MOD1 = 1e9 + 7;
const long long MOD2 = 1e9 + 9;
int n;
string s;
char tmp[N];
long long t[N], hsh[N], rhsh[N];
int f[N];
long long get_hash(int x, int y) { return hsh[y] - 1LL * t[y - x] * hsh[x]; }
long long rev_hash(int x, int y) { return rhsh[x] - 1LL * t[y - x] * rhsh[y]; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  scanf("%s", tmp);
  s = tmp;
  n = s.size();
  t[0] = 1;
  for (int i = 1; i <= n; i++) {
    t[i] = 1LL * t[i - 1] * base;
  }
  for (int i = 1; i <= n; i++) {
    hsh[i] = (1LL * hsh[i - 1] * base + s[i - 1]);
  }
  for (int i = n - 1; i >= 0; i--) {
    rhsh[i] = (1LL * rhsh[i + 1] * base + s[i]);
  }
  f[0] = 1;
  long long ans = 1;
  for (int i = 1; i < n; i++) {
    if (get_hash(0, (i + 1) / 2) == rev_hash(i / 2 + 1, i + 1))
      f[i] = f[(i - 1) / 2] + 1;
    else
      f[i] = 0;
    ans += f[i];
  }
  cout << ans << endl;
  return 0;
}
