#include <bits/stdc++.h>
using namespace std;
const int SIZE = 5e6 + 5;
int P[SIZE * 2], k[SIZE];
string convertToNewString(const string &s) {
  string newString = "@";
  for (int i = 0; i < s.size(); i++) {
    newString += "#" + s.substr(i, 1);
  }
  newString += "#$";
  return newString;
}
vector<int> v;
bool vis[SIZE];
void longestPalindromeSubstring(const string &s) {
  string Q = convertToNewString(s);
  int c = 0, r = 0;
  for (int i = 1; i < Q.size() - 1; i++) {
    int iMirror = c - (i - c);
    if (r > i) {
      P[i] = min(r - i, P[iMirror]);
    }
    while (Q[i + 1 + P[i]] == Q[i - 1 - P[i]]) {
      P[i]++;
    }
    if (i + P[i] > r) {
      c = i;
      r = i + P[i];
    }
  }
  for (int i = 1; i < Q.size() - 1; i++) {
    if (!P[i]) continue;
    int idx = (i - 1 - P[i]) / 2;
    if (!idx && !vis[P[i]]) v.push_back(P[i]), vis[P[i]] = 1;
  }
}
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  longestPalindromeSubstring(s);
  long long sum = 0;
  for (auto i : v) sum += (k[i] = k[i / 2] + 1);
  cout << sum;
}
