#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e6 + 10, base = 103;
int power[maxn] = {1}, hs1, hs2, ans, dp[maxn];
string s;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> s;
  for (int i = 1; i < maxn; i++) power[i] = power[i - 1] * base;
  for (int i = 0; i < s.size(); i++) {
    hs1 = hs1 * base + s[i] - 'a' + 1;
    hs2 = hs2 + (s[i] - 'a' + 1) * power[i];
    if (hs1 == hs2) ans += (dp[i + 1] = dp[(i + 1) / 2] + 1);
  }
  cout << ans << endl;
  return 0;
}
