#include <bits/stdc++.h>
using namespace std;
const int MAX = 5000009;
long long md = 2000000063;
long long mdi = 622568113;
long long bs = 257;
long long sv[MAX];
inline long long pow(long long n, long long p) {
  if (p == 0) return 1;
  if (sv[p]) return sv[p];
  long long t = pow(n, p / 2) % md;
  if (p % 2) return (((t * t) % md) * n) % md;
  return sv[p] = ((t * t) % md);
}
inline long long addDigit(long long n, long long val, long long ind) {
  long long temp = (pow(bs, ind) * val) % md;
  return (n + temp) % md;
}
inline long long shiftRight(long long n) { return (n * bs) % md; }
inline long long shiftLeft(long long n) { return (n * mdi) % md; }
inline long long removeDigit(long long n, long long val, long long ind) {
  long long temp = (pow(bs, ind) * val) % md;
  return (n + md - temp) % md;
}
char str[MAX];
long long k[MAX];
int main() {
  int n, i;
  scanf("%s", str);
  n = strlen(str);
  k[0] = 1;
  if (str[0] == str[1])
    k[1] = 2;
  else
    k[1] = 0;
  int res = k[0] + k[1];
  long long first = str[0], second = str[1];
  for (i = 2; i < n; ++i) {
    if (i & 1) {
      first = shiftRight(first);
      first = addDigit(first, str[i / 2], 0);
      second = addDigit(second, str[i], i / 2);
    } else {
      second = removeDigit(second, str[i / 2], 0);
      second = shiftLeft(second);
      second = addDigit(second, str[i], (i / 2) - 1);
    }
    if (first == second) {
      k[i] = k[(i - 1) / 2] + 1;
      res += k[i];
    }
  }
  cout << res << endl;
  return 0;
}
