#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
string s;
long long p[5000100], h[5000100], rh[5000100];
int pal[5000100];
long long ans = 1, n;
int main() {
  getline(cin, s);
  p[0] = 1;
  n = s.size();
  for (int i = 1; i < 5000100; i++) p[i] = p[i - 1] * 307;
  h[0] = int(s[0]);
  rh[0] = int(s[n - 1]);
  for (int i = 1; i < s.size(); i++) {
    h[i] = h[i - 1] + int(s[i]) * p[i];
    rh[i] = rh[i - 1] + int(s[n - i - 1]) * p[i];
  }
  pal[0] = 1;
  for (int i = 1; i < s.size(); i++) {
    int j = (i + 1) / 2 - 1, j1 = i - (i + 1) / 2 + 1;
    if (h[j] * p[n - j] ==
        (rh[n - j1 - 1] - ((i + 1 == n) ? (0) : (rh[n - i - 2]))) * p[j1 + 1])
      pal[i] = pal[j] + 1;
    ans += pal[i];
  }
  cout << ans;
  return 0;
}
