#include <bits/stdc++.h>
using namespace std;
unsigned long long int r = 0, l = 0, k = 1, Ti = 0, dp[5000005] = {0};
string s;
int main() {
  ios::sync_with_stdio(false);
  cin >> s;
  for (int i = 1; i <= s.size(); i++) {
    l = l * 33 + (s[i - 1] - 'A');
    r += (s[i - 1] - 'A') * k;
    k *= 33;
    if (r == l)
      dp[i] = dp[i / 2] + 1;
    else
      dp[i] = 0;
    Ti += dp[i];
  }
  cout << Ti << endl;
  return 0;
}
