#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e6 + 7;
string s;
int n, dp[maxn], val, curr, cnt = 1, ans = 1;
void solve() {
  cin >> s;
  n = s.size();
  memset(dp, 0, sizeof(dp));
  dp[0] = 1, val = s[0], curr = s[0];
  for (int i = 1; s[i]; ++i) {
    cnt *= 131, val *= 131;
    val += s[i];
    curr += s[i] * cnt;
    if (val == curr) {
      dp[i] = dp[(i - 1) >> 1] + 1;
    }
    ans += dp[i];
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
