#include <bits/stdc++.h>
using namespace std;
const int N = 5e6 + 5;
const int base = 303;
const int mod = 1e9 + 9;
string s;
int n, res, f[N];
long long hash_fw[N], hash_bw[N], pw[N];
long long gethash_fw(int x, int y) {
  return ((hash_fw[y] - hash_fw[x - 1] * pw[y + 1 - x]) % mod + mod) % mod;
}
long long gethash_bw(int x, int y) {
  return ((hash_bw[x] - hash_bw[y + 1] * pw[y + 1 - x]) % mod + mod) % mod;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> s;
  n = s.size();
  s = " " + s;
  pw[0] = 1;
  for (int i = 1; i <= n; i++) {
    pw[i] = (pw[i - 1] * base) % mod;
    hash_fw[i] = (hash_fw[i - 1] * base + (int)(s[i])) % mod;
  }
  for (int i = n; i >= 1; i--) {
    hash_bw[i] = (hash_bw[i + 1] * base + (int)(s[i])) % mod;
  }
  for (int i = 1; i <= n; i++) {
    if (gethash_fw(1, i) == gethash_bw(1, i)) {
      f[i] = f[i / 2] + 1;
      res += f[i];
    } else {
      f[i] = 0;
    }
  }
  cout << res << '\n';
  return 0;
}
