#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e6;
int deg[MAXN];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  unsigned long long hi = s[0], hb = s[0];
  unsigned long long base = 1e8 + 7;
  unsigned long long B = base;
  deg[0] = 1;
  int ans = 1;
  for (int pos = 1; pos < s.size(); ++pos) {
    hi *= base;
    hi += s[pos];
    hb += s[pos] * B;
    B *= base;
    if (hi == hb) {
      deg[pos] = deg[(pos - 1) >> 1] + 1;
      ans += deg[pos];
    }
  }
  cout << ans << endl;
}
