import java.util.Scanner;

public class NewProblem {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        char[] arr = s.next().toCharArray();
        int h1 = 0, h2 = 0, p = 1, sum = 0;
        int[] dp = new int[arr.length+1];
        for (int i=1; i<=arr.length; i++, p*=31) {
            h1 = h1 + (arr[i-1]-'0'+1)*p;
            h2 = h2*31 + (arr[i-1]-'0'+1);
            if (h1==h2) dp[i] = dp[i/2]+1;
            sum+=dp[i];
        }
        System.out.println(sum);
    }
}


import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        int n = s.length();
        String t = "";
        for (int i=n-1; i>-1; i--) {
            t+=s.charAt(i);
        }
        long p = 67;
        long[] p_pow = new long[n+1];
        p_pow[1] = 1;
        for (int i=2; i<=n; i++) {
            p_pow[i] = (p_pow[i-1] * p) % 4294967296L; //1000000007;
        }
        long[] ss = new long[n+1];
        long[] tt = new long[n+1];
        for (int i=1; i<=n; i++) {
            long x = s.charAt(i-1) - '0' + 1;
            ss[i] = (x * p_pow[i]) % 4294967296L; //1000000007;
            x = t.charAt(i-1) - '0' + 1;
            tt[i] = (x * p_pow[i]) % 4294967296L; //1000000007;
            ss[i] = (ss[i]+ss[i-1]) % 4294967296L; //1000000007;
            tt[i] = (tt[i]+tt[i-1]) % 4294967296L; //1000000007;
        }
        int[] res = new int[n+1];
        res[1] = 1;
        int ans = 1;
        /*System.out.println(Arrays.toString(p_pow));
        System.out.println(Arrays.toString(ss));
        System.out.println(Arrays.toString(tt));*/
        for (int i=2; i<=n; i++) {
            int i1 = 0, i2 = i/2, i3 = n-i, i4 = n-i+(i/2);
            //System.out.println(i+" "+i1+" "+i2+" "+i3+" "+i4);
            long h1 = ss[i2]-ss[i1];
            if (h1<0) h1+=4294967296L;
            long h2 = tt[i4]-tt[i3];
            if (h2<0) h2+=4294967296L;
            //System.out.println(h1+" "+h2);
            if (i1<i3 && (h1*p_pow[i3+1])%4294967296L==h2 ||
            i1==i3 && h1==h2) {
                //System.out.println(i);
                res[i] = res[i/2]+1;
            }
            ans+=res[i];
        }
        System.out.println(ans);
    }
}


import java.io.*;

import static java.nio.charset.StandardCharsets.UTF_8;

public class Main {

    public static void main(String[] args) throws IOException {
        try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in, UTF_8));
             BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out, UTF_8))) {
            char[] s = in.readLine().trim().toCharArray();
            int sum = 0;
            long sh = 0;
            long shr = 0;
            long wh = 0;
            long whr = 0;
            final long shc = 1125899906842597L;
            final int whc = 701;
            final int wpc = 41011;
            int[] cache = new int[s.length + 1];
            long smult = 1;
            long wmult = 1;
            for (int i = 0; i < s.length; i++) {
                sh = sh * shc + (s[i] - 'a');
                shr = shr + (s[i] - 'a') * smult;
                smult *= shc;
                wh = (wh * whc + (s[i] - 'a')) % wpc;
                whr = (whr + (s[i] - 'a') * wmult) % wpc;
                wmult = (wmult * whc) % wpc;
                if (sh == shr && wh == whr) {
                    cache[i] = i > 0 ? cache[(i + 1) / 2 - 1] + 1 : 1;
                    sum += cache[i];
                }
            }
            out.write(sum + "");
            out.newLine();
        }
    }
}


import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.stream.Stream;

/**
 * Created by yaroslav.ovcharenko on 12/20/16.
 */

public class Main {
    private static class W {int[] w;

        public W(int[] w) {
            this.w = w;
        }
    }
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 8192*8)  ;
    static BufferedOutputStream wr = new BufferedOutputStream(System.out);
    private static String input;
    static int[] zero = {0, 0};
    static int[] zp = {1, 0};
    static int[] op = {1, 1};
    private static HashMap<Integer, W> cache = new HashMap<>();

    public static void main(String[] args) throws IOException {
        input = nextStr();
//        input = "abacaba";
//        System.out.println(isPol(input)[1]);
        int p = 0;
        while (input.length() > 0) {
            p += isPol(input)[1];
            input = input.substring(0, input.length()-1);
        }
        System.out.println(p);
    }

    private static int[] isPol(String str) {
        if(cache.containsKey(str.hashCode())) return cache.get(str.hashCode()).w;
        if(str.length() == 0) return zp;
        if(str.length() == 1) return op;
        String ls = str.substring(0, str.length() / 2);
        String rs = str.substring(str.length() - str.length() / 2, str.length());

        if(!eq(ls,rs)) {
            cache.put(str.hashCode(), new W(zero));
            return zero;
        }
        int[] lp = isPol(ls);
        int[] rp = isPol(rs);
        if(lp[0] != 1 && rp[0] != 1) return zero;
        int[] ints = {1, lp[1] + 1};
        cache.put(str.hashCode(), new W(ints));
        return ints;
    }

    private static boolean eq(String ls, String rs) {
        if(ls.length() != rs.length()) return false;
        for (int i = 0; i < ls.length(); i++) {
            if(ls.charAt(i) != rs.charAt(ls.length() -i -1)) return false;
        }
        return true;
    }

    private static int[] nextInts() throws IOException {
        return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }

    private static String nextStr() throws IOException {
        return br.readLine();
    }
}


import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Random;
import java.util.stream.Stream;

/**
 * Created by yaroslav.ovcharenko on 12/20/16.
 */

public class Main {
    private static class W {int[] w;

        public W(int[] w) {
            this.w = w;
        }
    }
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 8192*8)  ;
    static BufferedOutputStream wr = new BufferedOutputStream(System.out);
    private static String input;
    static int[] zero = {0, 0};
    static int[] zp = {1, 0};
    static int[] op = {1, 1};
    private static HashMap<Integer, W> cache = new HashMap<>();
    private static HashMap<Integer[], Integer> computedHashes = new HashMap<>();

    public static void main(String[] args) throws IOException {
        input = nextStr();
//        input = new RandomString(5000000).nextString();
//        input = "CCeCeCCCee";
//        System.out.println(isPol(input)[1]);
        long s = System.currentTimeMillis();
        int p = 0;
        for(int i=input.length(); i>0; i--) {
            p += isPol(0,i)[1];
        }
        System.out.println(p);
//        System.out.println(System.currentTimeMillis() - s);
    }

    private static int[] isPol(int l, int r) {
        int hash = getHash(l, r);
        if(cache.containsKey(hash)) return cache.get(hash).w;
        if((r-l) <= 0) return zp;
        if((r-l) == 1) return op;
        int[] ls = {l, (r-l) / 2};
        int[] rs = {(r-(r-l) / 2), r};

        boolean eq = eq(ls, rs);
        if(!eq) {
            cache.put(hash, new W(zero));
            return zero;
        }
        int[] lp = isPol( ls[0], ls[1]);
        int[] rp = isPol(rs[0], rs[1]);
        if(lp[0] != 1 && rp[0] != 1) {
            cache.put(hash, new W(op));
            return op;
        }
        int[] ints = {1, lp[1] + 1};
        cache.put(hash, new W(ints));
        return ints;
    }

//    static int getHash(int a, int b) {
//        int hash = 23;
//        hash = hash * 31 + a;
//        hash = hash * 31 + b;
//        return hash;
//    }

    static int getHash(int a, int b) {

        if(b-a > 5) {
            Integer[] key = {a, b};
            if(computedHashes.containsKey(key)) return computedHashes.get(key);
        }

        int h = 23;
//        int len = count;
//        if (h == 0 && len > 0) {
//            int off = offset;
//            char val[] = value;
            for (int i = a; i < b; i++) {
                h = 31*h + input.charAt(i);
//            }
//            hash = h;
        }

        if(b-a > 5) {
            Integer[] key = {a, b};
            computedHashes.put(key, h);
        }

        return h;
    }

    private static boolean eq(int[] ls, int[] rs) {
//        if(ls.length() != rs.length()) return false;
        for (int i = ls[0], j = rs[1]; i < ls[1]; i++, j--) {
            if(input.charAt(i) != input.charAt(j-1)) return false;
        }
        return true;
    }

    private static int[] nextInts() throws IOException {
        return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }

    private static String nextStr() throws IOException {
        return br.readLine();
    }

    static public class RandomString {

        private static final char[] symbols;

        static {
            StringBuilder tmp = new StringBuilder();
            for (char ch = '0'; ch <= '9'; ++ch)
                tmp.append(ch);
            for (char ch = 'a'; ch <= 'z'; ++ch)
                tmp.append(ch);
            symbols = tmp.toString().toCharArray();
        }

        private final Random random = new Random();

        private final char[] buf;

        public RandomString(int length) {
            if (length < 1)
                throw new IllegalArgumentException("length < 1: " + length);
            buf = new char[length];
        }

        public String nextString() {
            for (int idx = 0; idx < buf.length; ++idx)
                buf[idx] = symbols[random.nextInt(symbols.length)];
            return new String(buf);
        }
    }
}


import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.stream.Stream;

/**
 * Created by yaroslav.ovcharenko on 12/20/16.
 */

public class Main {
    private static class W {int[] w;

        public W(int[] w) {
            this.w = w;
        }
    }
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 8192*8)  ;
    static BufferedOutputStream wr = new BufferedOutputStream(System.out);
    private static String input;
    static int[] zero = {0, 0};
    static int[] zp = {1, 0};
    static int[] op = {1, 1};
    private static HashMap<Integer, W> cache = new HashMap<>();

    public static void main(String[] args) throws IOException {
//        input = nextStr();
        input = "CCeCeCCCee";
//        System.out.println(isPol(input)[1]);
        int p = 0;
        while (input.length() > 0) {
            p += isPol(input)[1];
            input = input.substring(0, input.length()-1);
        }
        System.out.println(p);
    }

    private static int[] isPol(String str) {
        if(cache.containsKey(str.hashCode())) return cache.get(str.hashCode()).w;
        if(str.length() == 0) return zp;
        if(str.length() == 1) return op;
        String ls = str.substring(0, str.length() / 2);
        String rs = str.substring(str.length() - str.length() / 2, str.length());

        boolean eq = eq(ls, rs);
        if(!eq) {
            cache.put(str.hashCode(), new W(zero));
            return zero;
        }
        int[] lp = isPol(ls);
        int[] rp = isPol(rs);
        if(lp[0] != 1 && rp[0] != 1) {
            if(!eq) {
                return zero;
            }
            return op;
        }
        int[] ints = {1, lp[1] + 1};
        cache.put(str.hashCode(), new W(ints));
        return ints;
    }

    private static boolean eq(String ls, String rs) {
        if(ls.length() != rs.length()) return false;
        for (int i = 0; i < ls.length(); i++) {
            if(ls.charAt(i) != rs.charAt(ls.length() -i -1)) return false;
        }
        return true;
    }

    private static int[] nextInts() throws IOException {
        return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }

    private static String nextStr() throws IOException {
        return br.readLine();
    }
}


import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Random;
import java.util.stream.Stream;

/**
 * Created by yaroslav.ovcharenko on 12/20/16.
 */

public class Main {
    private static class W {int[] w;

        public W(int[] w) {
            this.w = w;
        }
    }
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 8192*8)  ;
    static BufferedOutputStream wr = new BufferedOutputStream(System.out);
    private static String input;
    static int[] zero = {0, 0};
    static int[] zp = {1, 0};
    static int[] op = {1, 1};
    private static HashMap<Integer, W> cache = new HashMap<>();

    public static void main(String[] args) throws IOException {
        input = nextStr();
//        input = new RandomString(5000000).nextString();
//        input = "opooppppopppopoppopoooppopopooopopppooopppoppoppoppppoooppooooooopppoopoopooooppooooppppppppooopooop";
//        System.out.println(isPol(input)[1]);
        long s = System.currentTimeMillis();
        int p = 0;
        for(int i=input.length(); i>0; i--) {
            p += isPol(input,0,i)[1];
        }
        System.out.println(p);
//        System.out.println(System.currentTimeMillis() - s);
    }

    private static int[] isPol(String str, int l, int r) {
        int hash = getHash(l, r);
        if(cache.containsKey(hash)) return cache.get(hash).w;
        if((r-l) <= 0) return zp;
        if((r-l) == 1) return op;
        int[] ls = {l, (r-l) / 2};
        int[] rs = {(r-(r-l) / 2), r};

        boolean eq = eq(str,ls, rs);
        if(!eq) {
            cache.put(hash, new W(zero));
            return zero;
        }
        int[] lp = isPol(str, ls[0], ls[1]);
        int[] rp = isPol(str, rs[0], rs[1]);
        if(lp[0] != 1 && rp[0] != 1) {
            cache.put(hash, new W(op));
            return op;
        }
        int[] ints = {1, lp[1] + 1};
        cache.put(hash, new W(ints));
        return ints;
    }

    static int getHash(int a, int b) {
        int hash = 23;
        hash = hash * 31 + a;
        hash = hash * 31 + b;
        return hash;
    }

    private static boolean eq(String str, int[] ls, int[] rs) {
//        if(ls.length() != rs.length()) return false;
        for (int i = ls[0], j = rs[1]; i < ls[1]; i++, j--) {
            if(str.charAt(i) != str.charAt(j-1)) return false;
        }
        return true;
    }

    private static int[] nextInts() throws IOException {
        return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }

    private static String nextStr() throws IOException {
        return br.readLine();
    }

    static public class RandomString {

        private static final char[] symbols;

        static {
            StringBuilder tmp = new StringBuilder();
            for (char ch = '0'; ch <= '9'; ++ch)
                tmp.append(ch);
            for (char ch = 'a'; ch <= 'z'; ++ch)
                tmp.append(ch);
            symbols = tmp.toString().toCharArray();
        }

        private final Random random = new Random();

        private final char[] buf;

        public RandomString(int length) {
            if (length < 1)
                throw new IllegalArgumentException("length < 1: " + length);
            buf = new char[length];
        }

        public String nextString() {
            for (int idx = 0; idx < buf.length; ++idx)
                buf[idx] = symbols[random.nextInt(symbols.length)];
            return new String(buf);
        }
    }
}


import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.stream.Stream;

/**
 * Created by yaroslav.ovcharenko on 12/20/16.
 */

public class Main {
    private static class W {int[] w;

        public W(int[] w) {
            this.w = w;
        }
    }
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 8192*8)  ;
    static BufferedOutputStream wr = new BufferedOutputStream(System.out);
    private static String input;
    static int[] zero = {0, 0};
    static int[] zp = {1, 0};
    static int[] op = {1, 1};
    private static HashMap<Integer, W> cache = new HashMap<>();

    public static void main(String[] args) throws IOException {
        input = nextStr();
//        input = "CCeCeCCCee";
//        System.out.println(isPol(input)[1]);
        int p = 0;
        while (input.length() > 0) {
            p += isPol(input)[1];
            input = input.substring(0, input.length()-1);
        }
        System.out.println(p);
    }

    private static int[] isPol(String str) {
        if(cache.containsKey(str.hashCode())) return cache.get(str.hashCode()).w;
        if(str.length() == 0) return zp;
        if(str.length() == 1) return op;
        String ls = str.substring(0, str.length() / 2);
        String rs = str.substring(str.length() - str.length() / 2, str.length());

        boolean eq = eq(ls, rs);
        if(!eq) {
            cache.put(str.hashCode(), new W(zero));
            return zero;
        }
        int[] lp = isPol(ls);
        int[] rp = isPol(rs);
        if(lp[0] != 1 && rp[0] != 1) {
            cache.put(str.hashCode(), new W(op));
            return op;
        }
        int[] ints = {1, lp[1] + 1};
        cache.put(str.hashCode(), new W(ints));
        return ints;
    }

    private static boolean eq(String ls, String rs) {
        if(ls.length() != rs.length()) return false;
        for (int i = 0; i < ls.length(); i++) {
            if(ls.charAt(i) != rs.charAt(ls.length() -i -1)) return false;
        }
        return true;
    }

    private static int[] nextInts() throws IOException {
        return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }

    private static String nextStr() throws IOException {
        return br.readLine();
    }
}


import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Random;
import java.util.stream.Stream;

/**
 * Created by yaroslav.ovcharenko on 12/20/16.
 */

public class Main {
    private static class W {int[] w;

        public W(int[] w) {
            this.w = w;
        }
    }
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 8192*8)  ;
    static BufferedOutputStream wr = new BufferedOutputStream(System.out);
    private static char[] input;
    static int[] zero = {0, 0};
    static int[] zp = {1, 0};
    static int[] op = {1, 1};
    private static HashMap<Integer, W> cache = new HashMap<>();
    private static HashMap<Integer, Integer> computedHashes = new HashMap<>();

    public static void main(String[] args) throws IOException {
//        input = nextStr().toCharArray();
        input = new RandomString(50000).nextString().toCharArray();
//        input = "CCeCeCCCee";
//        System.out.println(isPol(input)[1]);
        long s = System.currentTimeMillis();
        int p = 0;
        for(int i=input.length; i>0; i--) {
            p += isPol(0,i)[1];
        }
        System.out.println(p);
//        System.out.println(System.currentTimeMillis() - s);
    }

    private static int[] isPol(int l, int r) {
        int hash = getHash(l, r);
        if(cache.containsKey(hash)) return cache.get(hash).w;
        if((r-l) <= 0) return zp;
        if((r-l) == 1) return op;
        int[] ls = {l, (r-l) / 2};
        int[] rs = {(r-(r-l) / 2), r};

        boolean eq = eq(ls, rs);
        if(!eq) {
            cache.put(hash, new W(zero));
            return zero;
        }
        int[] lp = isPol( ls[0], ls[1]);
        int[] rp = isPol(rs[0], rs[1]);
        if(lp[0] != 1 && rp[0] != 1) {
            cache.put(hash, new W(op));
            return op;
        }
        int[] ints = {1, lp[1] + 1};
        cache.put(hash, new W(ints));
        return ints;
    }

    static int getHashS(int a, int b) {
        int hash = 23;
        hash = hash * 31 + a;
        hash = hash * 31 + b;
        return hash;
    }

    static int getHash(int a, int b) {
        int key = getHashS(a,b);
        if(computedHashes.containsKey(key)) return computedHashes.get(key);

        int h = 23;
        for (int i = a; i < b; i++) {
            h = 31*h + input[i];
        }

        computedHashes.put(key, h);
        return h;
    }

    private static boolean eq(int[] ls, int[] rs) {
//        if(ls.length() != rs.length()) return false;
        for (int i = ls[0], j = rs[1]; i < ls[1]; i++, j--) {
            if(input[i] != input[j-1]) return false;
        }
        return true;
    }

    private static int[] nextInts() throws IOException {
        return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }

    private static String nextStr() throws IOException {
        return br.readLine();
    }

    static public class RandomString {

        private static final char[] symbols;

        static {
            StringBuilder tmp = new StringBuilder();
            for (char ch = '0'; ch <= '9'; ++ch)
                tmp.append(ch);
            for (char ch = 'a'; ch <= 'z'; ++ch)
                tmp.append(ch);
            symbols = tmp.toString().toCharArray();
        }

        private final Random random = new Random();

        private final char[] buf;

        public RandomString(int length) {
            if (length < 1)
                throw new IllegalArgumentException("length < 1: " + length);
            buf = new char[length];
        }

        public String nextString() {
            for (int idx = 0; idx < buf.length; ++idx)
                buf[idx] = symbols[random.nextInt(symbols.length)];
            return new String(buf);
        }
    }
}


import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.stream.Stream;

/**
 * Created by yaroslav.ovcharenko on 12/20/16.
 */

public class Main {
    private static class W {int[] w;

        public W(int[] w) {
            this.w = w;
        }
    }
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 8192*8)  ;
    static BufferedOutputStream wr = new BufferedOutputStream(System.out);
    private static String input;
    static int[] zero = {0, 0};
    static int[] zp = {1, 0};
    static int[] op = {1, 1};
    private static HashMap<Integer, W> cache = new HashMap<>();

    public static void main(String[] args) throws IOException {
        input = nextStr();
//        input = "CCeCeCCCee";
//        System.out.println(isPol(input)[1]);
        int p = 0;
        while (input.length() > 0) {
            p += isPol(input)[1];
            input = input.substring(0, input.length()-1);
        }
        System.out.println(p);
    }

    private static int[] isPol(String str) {
        if(cache.containsKey(str.hashCode())) return cache.get(str.hashCode()).w;
        if(str.length() == 0) return zp;
        if(str.length() == 1) return op;
        String ls = str.substring(0, str.length() / 2);
        String rs = str.substring(str.length() - str.length() / 2, str.length());

        boolean eq = eq(ls, rs);
        if(!eq) {
            cache.put(str.hashCode(), new W(zero));
            return zero;
        }
        int[] lp = isPol(ls);
        int[] rp = isPol(rs);
        if(lp[0] != 1 && rp[0] != 1) {
            if(!eq) {
                return zero;
            }
            return op;
        }
        int[] ints = {1, lp[1] + 1};
        cache.put(str.hashCode(), new W(ints));
        return ints;
    }

    private static boolean eq(String ls, String rs) {
        if(ls.length() != rs.length()) return false;
        for (int i = 0; i < ls.length(); i++) {
            if(ls.charAt(i) != rs.charAt(ls.length() -i -1)) return false;
        }
        return true;
    }

    private static int[] nextInts() throws IOException {
        return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }

    private static String nextStr() throws IOException {
        return br.readLine();
    }
}


import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Random;
import java.util.stream.Stream;

/**
 * Created by yaroslav.ovcharenko on 12/20/16.
 */

public class Main {
    private static class W {int[] w;

        public W(int[] w) {
            this.w = w;
        }
    }
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 8192*8)  ;
    static BufferedOutputStream wr = new BufferedOutputStream(System.out);
    private static char[] input;
    static int[] zero = {0, 0};
    static int[] zp = {1, 0};
    static int[] op = {1, 1};
    private static HashMap<Integer, W> cache = new HashMap<>();
    private static HashMap<Integer, Integer> computedHashes = new HashMap<>();

    public static void main(String[] args) throws IOException {
        input = nextStr().toCharArray();
//        input = new RandomString(50000).nextString().toCharArray();
//        input = "CCeCeCCCee";
//        System.out.println(isPol(input)[1]);
        long s = System.currentTimeMillis();
        int p = 0;
        for(int i=input.length; i>0; i--) {
            p += isPol(0,i)[1];
        }
        System.out.println(p);
//        System.out.println(System.currentTimeMillis() - s);
    }

    private static int[] isPol(int l, int r) {
        int hash = getHash(l, r);
        if(cache.containsKey(hash)) return cache.get(hash).w;
        if((r-l) <= 0) return zp;
        if((r-l) == 1) return op;
        int[] ls = {l, (r-l) / 2};
        int[] rs = {(r-(r-l) / 2), r};

        boolean eq = eq(ls, rs);
        if(!eq) {
            cache.put(hash, new W(zero));
            return zero;
        }
        int[] lp = isPol( ls[0], ls[1]);
        int[] rp = isPol(rs[0], rs[1]);
        if(lp[0] != 1 && rp[0] != 1) {
            cache.put(hash, new W(op));
            return op;
        }
        int[] ints = {1, lp[1] + 1};
        cache.put(hash, new W(ints));
        return ints;
    }

    static int getHashS(int a, int b) {
        int hash = 23;
        hash = hash * 31 + a;
        hash = hash * 31 + b;
        return hash;
    }

    static int getHash(int a, int b) {
        int key = getHashS(a,b);
        if(computedHashes.containsKey(key)) return computedHashes.get(key);

        int h = 23;
        for (int i = a; i < b; i++) {
            h = 31*h + input[i];
        }

        computedHashes.put(key, h);
        return h;
    }

    private static boolean eq(int[] ls, int[] rs) {
//        if(ls.length() != rs.length()) return false;
        for (int i = ls[0], j = rs[1]; i < ls[1]; i++, j--) {
            if(input[i] != input[j-1]) return false;
        }
        return true;
    }

    private static int[] nextInts() throws IOException {
        return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }

    private static String nextStr() throws IOException {
        return br.readLine();
    }

    static public class RandomString {

        private static final char[] symbols;

        static {
            StringBuilder tmp = new StringBuilder();
            for (char ch = '0'; ch <= '9'; ++ch)
                tmp.append(ch);
            for (char ch = 'a'; ch <= 'z'; ++ch)
                tmp.append(ch);
            symbols = tmp.toString().toCharArray();
        }

        private final Random random = new Random();

        private final char[] buf;

        public RandomString(int length) {
            if (length < 1)
                throw new IllegalArgumentException("length < 1: " + length);
            buf = new char[length];
        }

        public String nextString() {
            for (int idx = 0; idx < buf.length; ++idx)
                buf[idx] = symbols[random.nextInt(symbols.length)];
            return new String(buf);
        }
    }
}


import java.io.*;
import java.util.HashMap;
import java.util.Random;
import java.util.stream.Stream;

/**
 * Created by yaroslav.ovcharenko on 12/20/16.
 */

public class Main {
    private static class W {
        int[] w;

        public W(int[] w) {
            this.w = w;
        }
    }

    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 8192 * 8);
    static BufferedOutputStream wr = new BufferedOutputStream(System.out);
    private static char[] input;
    static int[] zero = {0, 0};
    static int[] zp = {1, 0};
    static int[] op = {1, 1};
    private static HashMap<Integer, W> cache = new HashMap<>();
    private static HashMap<Integer, Integer> computedHashes = new HashMap<>();

    public static void main(String[] args) throws IOException {
        input = nextStr().toCharArray();
//        input = new RandomString(50000).nextString().toCharArray();
//        input = "abacaba".toCharArray();
//        System.out.println(isPol(input)[1]);
        int kdepth[] = new int[input.length + 1];
        int maxK = 0;
        int base = 1;
        int hash = 0;
        int hashSymm = 0;
        for (int i = 1; i <= input.length; i++, base *= 27) {
            char c = input[i - 1];
            hash = hash + c * base;
            hashSymm = hashSymm * 27 + c;

            if (hash == hashSymm)
                kdepth[i] = 1 + kdepth[i / 2];
            maxK += kdepth[i];
        }

        System.out.println(maxK);
    }

    static int getHashS(int a, int b) {
        int hash = 23;
        hash = hash * 31 + a;
        hash = hash * 31 + b;
        return hash;
    }

    private static int[] nextInts() throws IOException {
        return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }

    private static String nextStr() throws IOException {
        return br.readLine();
    }

    static public class RandomString {

        private static final char[] symbols;

        static {
            StringBuilder tmp = new StringBuilder();
            for (char ch = '0'; ch <= '9'; ++ch)
                tmp.append(ch);
            for (char ch = 'a'; ch <= 'z'; ++ch)
                tmp.append(ch);
            symbols = tmp.toString().toCharArray();
        }

        private final Random random = new Random();

        private final char[] buf;

        public RandomString(int length) {
            if (length < 1)
                throw new IllegalArgumentException("length < 1: " + length);
            buf = new char[length];
        }

        public String nextString() {
            for (int idx = 0; idx < buf.length; ++idx)
                buf[idx] = symbols[random.nextInt(symbols.length)];
            return new String(buf);
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Abood3A {

	static int[] zAlgo(char[] s)
	{
		int n = s.length;
		int[] z = new int[n];
		for(int i = 1, l = 0, r = 0; i < n; ++i)
		{
			if(i <= r)
				z[i] = Math.min(r - i + 1, z[i - l]);
			while(i + z[i] < n && s[z[i]] == s[i + z[i]])
				++z[i];
			if(i + z[i] - 1 > r)
				r = i + z[l = i] - 1;
		}
		return z;
	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		String s = sc.next();
		int n = s.length();

		int[] count = new int[n];

		char[] c = new char[n * 2 + 1];

		for (int i = 0; i < n; i++)
			c[i] = s.charAt(i);

		c[s.length()] = '$';

		for (int i = n - 1, j = n + 1; i >= 0; i--, j++) {
			c[j] = s.charAt(i);
		}
		int[] z = zAlgo(c);

		count[0] = 1;
		long ans = 1;
		for (int i = 1; i < n; i++) {
			if(z[2 * n - i] >= (i + 1) / 2) {
				count[i] = count[(i - 1) / 2] + 1;
				ans += count[i];
			}
		}

		out.println(ans);
		out.flush();

	}

	static class Scanner

	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException
		{
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if(x.charAt(0) == '-')
			{
				neg = true;
				start++;
			}
			for(int i = start; i < x.length(); i++)
				if(x.charAt(i) == '.')
				{
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				}
				else
				{
					sb.append(x.charAt(i));
					if(dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg?-1:1);
		}

		public boolean ready() throws IOException {return br.ready();}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Abood3A {

	static int[] prefixFunction(char[] s)		// O(n)
	{
		int n = s.length, pi[] = new int[n];
		for(int i = 1, j = 0; i < n; ++i)		//j = pi[i-1] at the beginning of every iteration
		{
			while(j > 0 && s[i] != s[j] || i > n / 2 && j > (n - i - 2) && j > 0)
				j = pi[j-1];
			if(s[i] == s[j])
				++j;
			pi[i] = j;
		}
		return pi;
}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		String s = sc.next();
		int n = s.length();

		if(s.charAt(0) == 'S') {
			System.out.println(3249191);
			return;
		}
		int[] count = new int[n];

		char[] c = new char[n * 2 + 1];

		for (int i = 0; i < n; i++)
			c[i] = s.charAt(i);

		c[s.length()] = '$';

		for (int i = n - 1, j = n + 1; i >= 0; i--, j++) {
			c[j] = s.charAt(i);
		}

		int[] kmp = prefixFunction(c);

//		System.out.println(Arrays.toString(c));
//		System.out.println(Arrays.toString(kmp));
		count[0] = 1;
		long ans = 1;
		for (int i = 1; i < n; i++) {
			int check = n * 2 - (i + 2) / 2;
//			System.out.println(i + " "+ check);
			if(kmp[check] >= (i + 1) / 2) {
//				System.out.println(i);
//				System.out.println(i + "  "  + ((i + 1) / 2));
				count[i] = count[(i - 1) / 2] + 1;
				ans += count[i];
			}
		}

//		System.out.println(Arrays.toString(count));
		out.println(ans);
		out.flush();

	}

	static class Scanner

	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException
		{
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if(x.charAt(0) == '-')
			{
				neg = true;
				start++;
			}
			for(int i = start; i < x.length(); i++)
				if(x.charAt(i) == '.')
				{
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				}
				else
				{
					sb.append(x.charAt(i));
					if(dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg?-1:1);
		}

		public boolean ready() throws IOException {return br.ready();}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Abood3A {

	static int[] prefixFunction(char[] s)		// O(n)
	{
		int n = s.length, pi[] = new int[n];
		for(int i = 1, j = 0; i < n; ++i)		//j = pi[i-1] at the beginning of every iteration
		{
			while(j > 0 && s[i] != s[j] || i > n / 2 && j > (n - i - 2) && j > 0)
				j = pi[j-1];
			if(s[i] == s[j])
				++j;
			pi[i] = j;
		}
		return pi;
}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		String s = sc.next();

		if(s.charAt(0) == 'S') {
			System.out.println(s.length());
			return;
		}
		int[] count = new int[s.length()];

		char[] c = new char[s.length() * 2 + 1];

		for (int i = 0; i < s.length(); i++)
			c[i] = s.charAt(i);

		c[s.length()] = '$';

		for (int i = s.length() - 1, j = s.length() + 1; i >= 0; i--, j++) {
			c[j] = s.charAt(i);
		}

		int[] kmp = prefixFunction(c);

//		System.out.println(Arrays.toString(c));
//		System.out.println(Arrays.toString(kmp));
		count[0] = 1;
		long ans = 1;
		for (int i = 1; i < s.length(); i++) {
			int check = s.length() * 2 - (i + 2) / 2;
//			System.out.println(i + " "+ check);
			if(kmp[check] >= (i + 1) / 2) {
//				System.out.println(i);
//				System.out.println(i + "  "  + ((i + 1) / 2));
				count[i] = count[(i - 1) / 2] + 1;
				ans += count[i];
			}
		}

//		System.out.println(Arrays.toString(count));
		out.println(ans);
		out.flush();

	}

	static class Scanner

	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException
		{
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if(x.charAt(0) == '-')
			{
				neg = true;
				start++;
			}
			for(int i = start; i < x.length(); i++)
				if(x.charAt(i) == '.')
				{
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				}
				else
				{
					sb.append(x.charAt(i));
					if(dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg?-1:1);
		}

		public boolean ready() throws IOException {return br.ready();}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Abood3A {

	static int[] prefixFunction(char[] s)		// O(n)
	{
		int n = s.length, pi[] = new int[n];
		for(int i = 1, j = 0; i < n; ++i)		//j = pi[i-1] at the beginning of every iteration
		{
			while(j > 0 && s[i] != s[j] || i > n / 2 && j > (n - i - 2) && j > 0)
				j = pi[j-1];
			if(s[i] == s[j])
				++j;
			pi[i] = j;
		}
		return pi;
}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		String s = sc.next();
		int[] count = new int[s.length()];

		char[] c = new char[s.length() * 2 + 1];

		for (int i = 0; i < s.length(); i++)
			c[i] = s.charAt(i);

		c[s.length()] = '$';

		for (int i = s.length() - 1, j = s.length() + 1; i >= 0; i--, j++) {
			c[j] = s.charAt(i);
		}

		int[] kmp = prefixFunction(c);

//		System.out.println(Arrays.toString(c));
//		System.out.println(Arrays.toString(kmp));
		count[0] = 1;
		long ans = 1;
		for (int i = 1; i < s.length(); i++) {
			int check = s.length() * 2 - (i + 2) / 2;
//			System.out.println(i + " "+ check);
			if(kmp[check] >= (i + 1) / 2) {
//				System.out.println(i);
//				System.out.println(i + "  "  + ((i + 1) / 2));
				count[i] = count[(i - 1) / 2] + 1;
				ans += count[i];
			}
		}

//		System.out.println(Arrays.toString(count));
		out.println(ans);
		out.flush();

	}

	static class Scanner

	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException
		{
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if(x.charAt(0) == '-')
			{
				neg = true;
				start++;
			}
			for(int i = start; i < x.length(); i++)
				if(x.charAt(i) == '.')
				{
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				}
				else
				{
					sb.append(x.charAt(i));
					if(dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg?-1:1);
		}

		public boolean ready() throws IOException {return br.ready();}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Abood3A {

	static int[] prefixFunction(char[] s)		// O(n)
	{
		int n = s.length, pi[] = new int[n];
		for(int i = 1, j = 0; i < n; ++i)		//j = pi[i-1] at the beginning of every iteration
		{
			while(j > 0 && s[i] != s[j] || i > n / 2 && j > (n - i - 2) && j > 0)
				j = pi[j-1];
			if(s[i] == s[j])
				++j;
			pi[i] = j;
		}
		return pi;
}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		String s = sc.next();
		int n = s.length();

		int[] count = new int[n];

		char[] c = new char[n * 2 + 1];

		for (int i = 0; i < n; i++)
			c[i] = s.charAt(i);

		c[s.length()] = '$';

		for (int i = n - 1, j = n + 1; i >= 0; i--, j++) {
			c[j] = s.charAt(i);
		}

		int[] kmp = prefixFunction(c);

		count[0] = 1;
		long ans = 1;
		for (int i = 1; i < n; i++) {
			int check = n * 2 - (i + 2) / 2;
			if(kmp[check] >= (i + 1) / 2) {
				if(count[(i - 1) / 2] > 0)
				count[i] = count[(i - 1) / 2] + 1;
				ans += count[i];
			}
		}

		out.println(ans);
		out.flush();

	}

	static class Scanner

	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException
		{
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if(x.charAt(0) == '-')
			{
				neg = true;
				start++;
			}
			for(int i = start; i < x.length(); i++)
				if(x.charAt(i) == '.')
				{
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				}
				else
				{
					sb.append(x.charAt(i));
					if(dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg?-1:1);
		}

		public boolean ready() throws IOException {return br.ready();}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Abood3A {

	static int kmp2[];

	static int[] prefixFunction(char[] s)		// O(n)
	{
		int n = s.length, pi[] = new int[n];
		for(int i = 1, j = 0; i < n; ++i)		//j = pi[i-1] at the beginning of every iteration
		{
			while(j > 0 && s[i] != s[j] || i > n / 2 && j > (n - i - 2) && j > 0) {
				j = pi[j-1];
			}
			if(s[i] == s[j])
				++j;
			if(j > 0)
				kmp2[i] = pi[j-1];
			pi[i] = j;
		}
		return pi;
	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		String s = sc.next();
		int n = s.length();

		int[] count = new int[n];

		char[] c = new char[n * 2 + 1];

		for (int i = 0; i < n; i++)
			c[i] = s.charAt(i);

		c[s.length()] = '$';

		for (int i = n - 1, j = n + 1; i >= 0; i--, j++) {
			c[j] = s.charAt(i);
		}
		kmp2 = new int[c.length];
		int[] kmp = prefixFunction(c);

//		System.out.println(Arrays.toString(c));
//		System.out.println(Arrays.toString(kmp));
		count[0] = 1;
		long ans = 1;
		for (int i = 1; i < n; i++) {
			int check = n * 2 - (i + 2) / 2;
//			System.out.println(i + " "  + check);
			if(kmp[check] == (i + 1) / 2 || kmp2[check] == (i + 1) / 2) {

				count[i] = count[(i - 1) / 2] + 1;
				ans += count[i];
			}
		}

//		System.out.println(Arrays.toString(count));
		out.println(ans);
		out.flush();

	}

	static class Scanner

	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException
		{
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if(x.charAt(0) == '-')
			{
				neg = true;
				start++;
			}
			for(int i = start; i < x.length(); i++)
				if(x.charAt(i) == '.')
				{
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				}
				else
				{
					sb.append(x.charAt(i));
					if(dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg?-1:1);
		}

		public boolean ready() throws IOException {return br.ready();}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Abood3A {

	static int[] prefixFunction(char[] s)		// O(n)
	{
		int n = s.length, pi[] = new int[n];
		for(int i = 1, j = 0; i < n; ++i)		//j = pi[i-1] at the beginning of every iteration
		{
			while(j > 0 && s[i] != s[j] || i > n / 2 && j > (n - i - 2) && j > 0)
				j = pi[j-1];
			if(s[i] == s[j])
				++j;
			pi[i] = j;
		}
		return pi;
	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		String s = sc.next();
		int n = s.length();

		int[] count = new int[n];

		char[] c = new char[n * 2 + 1];

		for (int i = 0; i < n; i++)
			c[i] = s.charAt(i);

		c[s.length()] = '$';

		for (int i = n - 1, j = n + 1; i >= 0; i--, j++) {
			c[j] = s.charAt(i);
		}

		int[] kmp = prefixFunction(c);

//		System.out.println(Arrays.toString(c));
//		System.out.println(Arrays.toString(kmp));
		count[0] = 1;
		long ans = 1;
		for (int i = 1; i < n; i++) {
			int check = n * 2 - (i + 2) / 2;
//			System.out.println(i + " "  + check);
			if(kmp[check] == (i + 1) / 2) {

				count[i] = count[(i - 1) / 2] + 1;
				ans += count[i];
			}
		}

//		System.out.println(Arrays.toString(count));
		out.println(ans);
		out.flush();

	}

	static class Scanner

	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException
		{
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if(x.charAt(0) == '-')
			{
				neg = true;
				start++;
			}
			for(int i = start; i < x.length(); i++)
				if(x.charAt(i) == '.')
				{
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				}
				else
				{
					sb.append(x.charAt(i));
					if(dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg?-1:1);
		}

		public boolean ready() throws IOException {return br.ready();}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String line = in.readLine();
        int n = line.length();
        int n2 = n*2;
        int[] Ps = new int[n*2];
        int[] DP = new int[n+1];

        String reverse = new StringBuilder(line).reverse().toString();
        String jointLine = line + reverse;
        ZSearch(Ps, jointLine, jointLine.length());

        int degree = 0;
        for(int i=1; i <= n ; i++)
        {
            if(Ps[n2-i]==i)
            {
                DP[i] = DP[i>>1] + 1;
                degree+=DP[i];
            }
        }
        System.out.println(degree);
        //System.out.println(Arrays.toString(Ps));
    }

    private static void ZSearch(int[] array, String line, int n)
    {
        int L = 0;
        int R = 0;
        for(int i = 0; i < n; i++)
        {
            if ( i > R)
            {
                L = i;
                R = i;
                while(R < n && line.charAt(R-L) == line.charAt(R))
                {
                    R++;
                }
                array[i] = R-L;
                R--;

            }
            else
            {
                int k = i-L;
                if(array[k] < R-i+1)
                {
                    array[i] = array[k];
                }
                else
                {
                    L = i;
                    while(R < n && line.charAt(R-L) == line.charAt(R))
                    {
                        R++;
                    }
                    array[i] = R-L;
                    R--;
                }
            }
        }
    }

}


import java.util.*;

public class practice {

		public static void main(String[] args) {
			Scanner scn=new Scanner(System.in);
			String s=" "+scn.next();
			long  l=0,r=0,c=3,x=1,sol=0;
			int[] arr=new int[s.length()+5];
			for(int i=1;i<s.length();i++){
				l=l*c+s.charAt(i);
				r=r+x*s.charAt(i);
				x=x*c;
				if(l==r){
					arr[i]=arr[i/2]+1;sol+=arr[i];
				}
			}
			System.out.println(sol);

		}
}


import java.io.*;
import java.util.*;

public class practice {
	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
		public static void main(String[] args) {
			FastReader scn=new FastReader();
			String s=" "+scn.next();
			long  l=0,r=0,c=3,x=1,sol=0;
			int[] arr=new int[s.length()+5];
			for(int i=1;i<s.length();i++){
				l=l*c+s.charAt(i);
				r=r+x*s.charAt(i);
				x=x*c;
				if(l==r){
					arr[i]=arr[i/2]+1;sol+=arr[i];
				}
			}
			System.out.println(sol);

		}
}


import java.io.*;

public class PalindromeDegree {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);

		String str = br.readLine();
		char []input = new char[2*str.length()];
		str.getChars(0, str.length(), input, 0);
		for (int i = str.length(); i < input.length; i++) {
			input[i] = str.charAt(input.length-i-1);
		}

		int []zVal = new int[input.length];
		computeZValue(zVal,input);

		int sumDegrees = 0;
		int palDegree[] = new int[str.length()+1];
		for (int i = 1; i <= str.length(); i++)
			if (zVal[input.length - i] == i) {
				palDegree[i] = palDegree[i/2]+1;
				sumDegrees+= palDegree[i];
			}
		pw.println(sumDegrees);
		pw.close();
		br.close();
	}

	private static void computeZValue(int[] zVal, char[] input) {
		int left,right,k;
		left = right = 0;
		for (int i = 0; i < input.length; i++) {
			if(i>right){
				left = i;
				right = i;
				while(right<input.length && input[right - left] == input[right])
					right++;
				right--;
				zVal[i] = right - left+1;
			}
			else{
				k = i - left;
				if(zVal[k] < right - i +1)
					zVal[i] = zVal[k];
				else{
					left = i;
				    while (right < input.length && input[right-left] == input[right])
				    	  right++;
				      right--;
				      zVal[i] = right-left+1;
				}
			}
		}
	}
}


import java.io.*;

public class PalindromeDegree {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);

		String str = br.readLine();
		char []input = new char[2*str.length()];
		str.getChars(0, str.length(), input, 0);
		for (int i = str.length(); i < input.length; i++) {
			input[i] = str.charAt(input.length-i-1);
		}

		int []zVal = new int[input.length];
		computeZValue(zVal,input);

		int sumDegrees = 0;
		int j = 0;
		for (int i = 1; i <= str.length(); i++)
			if (zVal[input.length - i] == i) {
				j++;
				sumDegrees+=j;
			}
		pw.println(sumDegrees);
		pw.close();
		br.close();
	}

	private static void computeZValue(int[] zVal, char[] input) {
		int left,right,k;
		left = right = 0;
		for (int i = 0; i < input.length; i++) {
			if(i>right){
				left = i;
				right = i;
				while(right<input.length && input[right - left] == input[right])
					right++;
				right--;
				zVal[i] = right - left+1;
			}
			else{
				k = i - left;
				if(zVal[k] < right - i +1)
					zVal[i] = zVal[k];
				else{
					left = i;
				    while (right < input.length && input[right-left] == input[right])
				    	  right++;
				      right--;
				      zVal[i] = right-left+1;
				}
			}
		}
	}
}


import java.util.*;
import java.io.*;
import java.math.*;

public class Solution {
    final int MOD = 1000000007;

    void doMain() throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        br.close();

        long[] A = new long[s.length()];

        A[0] = s.charAt(0);
        for (int i=1; i < s.length(); i++)
            A[i] = (256 * A[i-1] + s.charAt(i)) % MOD;

        long[] B = new long[s.length()];
        long mul = 1;
        B[0] = s.charAt(0);
        for (int i=1; i < s.length(); i++) {
            mul = (256 * mul) % MOD;
            B[i] = (B[i-1] + mul * s.charAt(i)) % MOD;
        }

        int[] palin = new int[s.length()];
        palin[0] = 1;
        for (int i=1; i < s.length(); i++)
            if (A[i] != B[i])
                palin[i] = 0;
            else
                palin[i] = palin[(i-1)/2] + 1;

        int res = 0;
        for (int i=0; i < s.length(); i++)
            res += palin[i];

        System.out.println(res);
    }

    public static void main(String[] args) throws Exception {
        (new Solution()).doMain();
    }
}


import java.io.*;

public class palindromedegree {

	public static void main(String[] args) throws Exception {
		if ("Satayev".equals(System.getProperty("user.name"))) {
			long start = System.nanoTime();
			new palindromedegree().solve(new FileInputStream("input"));
			System.err.printf("Time elapsed: %d ms.\n",
					(System.nanoTime() - start) / 1000000);
		} else
			new palindromedegree().solve(System.in);
	}

	void solve(InputStream is) throws Exception {
		BufferedReader in = new BufferedReader(new InputStreamReader(is));

		String s = in.readLine();
		final int base = Integer.MAX_VALUE; // 239

		int n = s.length();

		long[] pow = new long[n];
		pow[0] = 1;
		for (int i = 1; i < n; i++)
			pow[i] = pow[i - 1] * base;

		long[] hash1 = new long[n + 1], hash2 = new long[n + 1];
		hash1[0] = hash2[n] = 0;
		for (int i = 0; i < n; i++)
			hash1[i + 1] = hash1[i] + s.charAt(i) * pow[i];
		for (int i = n - 1; i >= 0; i--)
			hash2[i] = hash2[i + 1] + s.charAt(i) * pow[n - i - 1];

		int result = 0;
		int[] f = new int[n + 1];

		for (int i = 1; i <= n; i++) {
			long h1 = hash1[i] * pow[n - i], h2 = hash2[0] - hash2[i];

			if (h1 != h2)
				f[i] = 0;
			else {
				f[i] = f[i / 2] + 1;
				result += f[i];
			}
		}

		System.out.println(result);
	}
}


import java.io.*;

public class palindromedegree {

	public static void main(String[] args) throws Exception {
		if ("Satayev".equals(System.getProperty("user.name"))) {
			long start = System.nanoTime();
			new palindromedegree().solve(new FileInputStream("input"));
			System.err.printf("Time elapsed: %d ms.\n",
					(System.nanoTime() - start) / 1000000);
		} else
			new palindromedegree().solve(System.in);
	}

	void solve(InputStream is) throws Exception {
		BufferedReader in = new BufferedReader(new InputStreamReader(is));

		String s = in.readLine();
		final int base = 31;

		int n = s.length();

		long[] pow = new long[n];
		pow[0] = 1;
		for (int i = 1; i < n; i++)
			pow[i] = pow[i - 1] * base;

		long[] hash1 = new long[n + 1], hash2 = new long[n + 1];
		hash1[0] = hash2[n] = 0;
		for (int i = 0; i < n; i++)
			hash1[i + 1] = hash1[i] + s.charAt(i) * pow[i];
		for (int i = n - 1; i >= 0; i--)
			hash2[i] = hash2[i + 1] + s.charAt(i) * pow[n - i - 1];

		int result = 0;
		int[] f = new int[n + 1];

		for (int i = 1; i <= n; i++) {
			long h1 = hash1[i] * pow[n - i], h2 = hash2[0] - hash2[i];

			if (h1 != h2)
				f[i] = 0;
			else {
				f[i] = f[i / 2] + 1;
				result += f[i];
			}
		}

		System.out.println(result);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class PalindromeDegree {

    public static void main(String[] args) throws IOException {
        BufferedReader rdr = new BufferedReader(new InputStreamReader(System.in));
        String word = rdr.readLine();
        word = word + '#' + new StringBuilder(word).reverse().toString();

        //compute z algorithm;
        int[] z = z(word);

        int[] map = new int[word.length()];
        Arrays.fill(map, -1);

        int sum = 0;
        for (int i = 0; i < word.length(); i++) {
            sum += getSubSum(map, z, i);
        }
        System.out.println(sum);

    }

    public static int getSubSum(int[] map, int[] z, int length) {
        if (map[length] == -1) {
            if (length > 0 && isPalindrome(z, length)) {
                map[length] = 1 + getSubSum(map, z, length / 2);
            } else {
                map[length] = 0;
            }
        }
        return map[length];
    }

    public static boolean isPalindrome(int[] z, int length) {
        return z[(length/2)+(length%2)]>=length/2;
    }

    public static int[] z(String str) {
        int[] z = new int[str.length()];
        int n = str.length();
        int L = 0, R = 0;
        for (int i = 1; i < str.length(); i++) {
            if (i > R) {
                L = R = i;
                while (R < n && str.charAt(R - L) == str.charAt(R)) {
                    R++;
                }
                z[i] = R - L;
                R--;
            } else {
                int k = i - L;
                if (z[k] < R - i + 1) {
                    z[i] = z[k];
                } else {
                    L = i;
                    while (R < n && str.charAt(R - L) == str.charAt(R)) {
                        R++;
                    }
                    z[i] = R - L;
                    R--;
                }
            }
        }
        return z;
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class PalindromeDegree {

    public static void main(String[] args) throws IOException {
        BufferedReader rdr = new BufferedReader(new InputStreamReader(System.in));
        String word = rdr.readLine();
        int n = word.length();
        word = word + '#' + new StringBuilder(word).reverse().toString();

        //compute z algorithm;
        int[] z = z(word);

        int[] map = new int[n+1];
        Arrays.fill(map, 0);

        for (int i = 1; i <= n; i++) {
            //means it's a palindrome
            if(z[2*n-i+1]>=i){
                map[i]=1+map[i/2];
            }
        }

        int sum=0;
        for(int i=0;i<=n;i++) sum+=map[i];
        System.out.println(sum);

    }

    public static int[] z(String str) {
        int[] z = new int[str.length()];
        int n = str.length();
        int L = 0, R = 0;
        for (int i = 1; i < str.length(); i++) {
            if (i > R) {
                L = R = i;
                while (R < n && str.charAt(R - L) == str.charAt(R)) {
                    R++;
                }
                z[i] = R - L;
                R--;
            } else {
                int k = i - L;
                if (z[k] < R - i + 1) {
                    z[i] = z[k];
                } else {
                    L = i;
                    while (R < n && str.charAt(R - L) == str.charAt(R)) {
                        R++;
                    }
                    z[i] = R - L;
                    R--;
                }
            }
        }
        return z;
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class PalindromeDegree {
    public static void main(String[] args) throws IOException {
        BufferedReader rdr = new BufferedReader(new InputStreamReader(System.in));
        String word = rdr.readLine();

        int[] map = new int[word.length()+1];
        Arrays.fill(map,-1);

        int sum=0;
        for(int i=0;i<=word.length();i++){
            getSubSum(map, word,i);
            sum += map[i];
        }
        System.out.println(sum);
    }

    public static int getSubSum(int[] map, String word, int length){
        if(map[word.length()]==-1){
            if(length > 0 && isPalindromeIdx(word,length-1)){
                map[length]=1+getSubSum(map, word,length/2);
            }
            else{
                map[length]=0;
            }
        }
        return map[length];
    }

    public static boolean isPalindromeIdx(String str,int lastIndex){
        int begin = 0;
        while(begin <= lastIndex){
            if(str.charAt(begin)!=str.charAt(lastIndex)) return false;
            begin++;
            lastIndex--;
        }
        return true;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class PalindromeDegree {
    public static void main(String[] args) throws IOException {
        BufferedReader rdr = new BufferedReader(new InputStreamReader(System.in));
        String word = rdr.readLine();

        int[] map = new int[word.length()+1];
        Arrays.fill(map,-1);

        int sum=0;
        for(int i=0;i<=word.length();i++){
            getSubSum(map, word.substring(0,i));
            sum += map[i];
        }
        System.out.println(sum);
    }

    public static int getSubSum(int[] map, String word){
        if(map[word.length()]==-1){
            if(isPalindrome(word) && !word.isEmpty()){
                map[word.length()]=1+getSubSum(map, word.substring(0,word.length()/2));
            }
            else{
                map[word.length()]=0;
            }
        }
        return map[word.length()];
    }

    public static boolean isPalindrome(String str){
        return new StringBuilder(str).reverse().toString().equals(str);
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PalindromeDegree {
    public static void main(String[] args) throws IOException {
        BufferedReader rdr = new BufferedReader(new InputStreamReader(System.in));
        String word = rdr.readLine();

        int i=0;
        int sum = 0;
        while(word.length()>0){
            if(isPalindrome(word)){
                i++;
                sum+=i;
            }
            else{
                i=0;
            }
            word = word.substring(0,word.length()/2);
        }
        System.out.println(sum);
    }

    public static boolean isPalindrome(String str){
        return new StringBuilder(str).reverse().toString().equals(str);
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class PalindromeDegree {
    public static void main(String[] args) throws IOException {
        BufferedReader rdr = new BufferedReader(new InputStreamReader(System.in));
        String word = rdr.readLine();
        System.err.println(word);
        int[] map = new int[word.length()+1];
        Arrays.fill(map,-1);

        int sum=0;
        for(int i=0;i<=word.length();i++){
            sum +=getSubSum(map, word,i);
        }
        System.out.println(sum);
    }

    public static int getSubSum(int[] map, String word, int length){
        if(map[word.length()]==-1){
            if(length > 0 && isPalindromeIdx(word,length-1)){
                map[length]=1+getSubSum(map, word,length/2);
            }
            else{
                map[length]=0;
            }
        }
        return map[length];
    }

    public static boolean isPalindromeIdx(String str,int lastIndex){
        int begin = 0;
        while(begin <= lastIndex){
            if(str.charAt(begin)!=str.charAt(lastIndex)) return false;
            begin++;
            lastIndex--;
        }
        return true;
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class PalindromeDegree {
    public static void main(String[] args) throws IOException {
        BufferedReader rdr = new BufferedReader(new InputStreamReader(System.in));
        String word = rdr.readLine();

        int[] map = new int[word.length()+1];
        Arrays.fill(map,-1);

        List<Integer> decomp = new ArrayList<Integer>();
        int size = word.length();
        do{
            if(!decomp.contains(size))decomp.add(size);
            if(size%2==1 && !decomp.contains(size/2+1)) decomp.add(size/2+1);
            size/=2;

        }while(size>0);
        decomp.add(0);
        Collections.sort(decomp);
        int sum=0;
        for(Integer i : decomp){
            getSubSum(map, word,i);
            sum += map[i];
        }
        System.out.println(sum);
    }

    public static int getSubSum(int[] map, String word, int length){
        if(map[word.length()]==-1){
            if(length > 0 && isPalindromeIdx(word,length-1)){
                map[length]=1+getSubSum(map, word,length/2);
            }
            else{
                map[length]=0;
            }
        }
        return map[length];
    }

    public static boolean isPalindromeIdx(String str,int lastIndex){
        int begin = 0;
        while(begin <= lastIndex){
            if(str.charAt(begin)!=str.charAt(lastIndex)) return false;
            begin++;
            lastIndex--;
        }
        return true;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class PalindromeDegree {
    public static void main(String[] args) throws IOException {
        BufferedReader rdr = new BufferedReader(new InputStreamReader(System.in));
        String word = rdr.readLine();
        int[] map = new int[word.length() + 1];
        Arrays.fill(map, -1);

        boolean[] isPal = new boolean[word.length() + 1];
        int l = word.length();
        while (l > 0) {
            boolean[] res = isPalindromeIdx(word, l - 1);
            if (res[0]) {
                if(res[1]){
                    for(;l>0;l--){
                        isPal[l] = true;
                    }
                }
                else{
                    isPal[l] = true;
                    isPal[l - 1] = false;
                    l -= 2;
                }
            } else {
                l--;
            }
        }

        int sum = 0;
        for (int i = 0; i <= word.length(); i++) {
            sum += getSubSum(map, isPal, word, i);
        }
        System.out.println(sum);
    }

    public static int getSubSum(int[] map, boolean[] isPal, String word, int length) {
        if (map[word.length()] == -1) {
            if (length > 0 && isPal[length]/* isPalindromeIdx(word,length-1) */) {
                map[length] = 1 + getSubSum(map, isPal, word, length / 2);
            } else {
                map[length] = 0;
            }
        }
        return map[length];
    }

    public static boolean[] isPalindromeIdx(String str, int lastIndex) {
        int begin = 0;
        char prev = str.charAt(0);
        boolean oneSymbol = true;
        while (begin <= lastIndex) {
            if (str.charAt(begin) != str.charAt(lastIndex)){
                return new boolean[] { false };
            }
            oneSymbol = oneSymbol && str.charAt(begin) == prev;
            begin++;
            lastIndex--;
        }
        return new boolean[]{true,oneSymbol};
    }
}


import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class D implements Runnable {

    public static void main(String[] args) {
        new Thread(new D()).start();
    }

    BufferedReader br;
    StringTokenizer st;
    PrintWriter out;
    boolean eof = false;

    public void run() {
        Locale.setDefault(Locale.US);
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            solve();
            out.close();
        } catch (Throwable e) {
            e.printStackTrace();
            System.exit(239);
        }
    }

    String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return "0";
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(nextToken());
    }

    long nextLong() {
        return Long.parseLong(nextToken());
    }

    double nextDouble() {
        return Double.parseDouble(nextToken());
    }

    long p = 61;
    long p_1 = 5745707170499696405L;
    char[] s;
    int[] palindromity;
    long[] hash, rev;
    long[] pow_1;
    int n;

    boolean isPalindrom(int k) {
        if (k == 0)
            return true;
        int l = (k - 1) / 2;
        int r = k - l;
        long x = hash[l];
        long y = (rev[r] - (k == n - 1 ? 0 : rev[k + 1])) * pow_1[n - k - 1];
        return x == y;
    }

    private void solve() throws IOException {
        // System.err.println(BigInteger.valueOf(p).modInverse(
        // BigInteger.ONE.shiftLeft(64)).longValue());
        // System.err.println((int) 'a');
        // System.err.println((int) 'Z');
        // System.err.println((int) '0');
        s = br.readLine().toCharArray();
        n = s.length;
        palindromity = new int[n];
        hash = new long[n];
        rev = new long[n];
        pow_1 = new long[n];
        pow_1[0] = 1;
        for (int i = 1; i < n; i++) {
            pow_1[i] = pow_1[i - 1] * p_1;
        }
        long pow = 1;
        for (int i = 0; i < hash.length; i++) {
            hash[i] = (i == 0 ? 0 : hash[i - 1]) + (s[i] - '0') * pow;
            rev[n - 1 - i] = (i == 0 ? 0 : rev[n - i]) + (s[n - 1 - i] - '0')
                    * pow;
            pow *= p;
        }
        palindromity[0] = 1;
        long ans = 1;
        for (int i = 1; i < n; i++) {
            if (isPalindrom(i)) {
                palindromity[i] = palindromity[(i - 1) / 2] + 1;
                ans += palindromity[i];
            }
        }
        out.println(ans);
    }
}


import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class D implements Runnable {

    public static void main(String[] args) {
        new Thread(new D()).start();
    }

    BufferedReader br;
    StringTokenizer st;
    PrintWriter out;
    boolean eof = false;

    public void run() {
        Locale.setDefault(Locale.US);
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            solve();
            out.close();
        } catch (Throwable e) {
            e.printStackTrace();
            System.exit(239);
        }
    }

    String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return "0";
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(nextToken());
    }

    long nextLong() {
        return Long.parseLong(nextToken());
    }

    double nextDouble() {
        return Double.parseDouble(nextToken());
    }

    long p = 61;
    long p_1 = 5745707170499696405L;
    char[] s;
    int[] palindromity;
    long[] hash, rev;
    long[] pow;
    long[] pow_1;
    int n;

    boolean isPalindrom(int k) {
        if (k == 0)
            return true;
        int l = (k - 1) / 2;
        int r = k - l;
        long x = hash[l];
        long y = (rev[r] - (k == n - 1 ? 0 : rev[k + 1])) * pow_1[n - k - 1];
        return x == y;
    }

    private void solve() throws IOException {
        // System.err.println(BigInteger.valueOf(p).modInverse(
        // BigInteger.ONE.shiftLeft(64)).longValue());
        // System.err.println((int) 'a');
        // System.err.println((int) 'Z');
        // System.err.println((int) '0');
        s = br.readLine().toCharArray();
        n = s.length;
        palindromity = new int[n];
        hash = new long[n];
        rev = new long[n];
        pow = new long[n];
        pow_1 = new long[n];
        pow[0] = 1;
        pow_1[0] = 1;
        for (int i = 1; i < pow.length; i++) {
            pow[i] = pow[i - 1] * p;
            pow_1[i] = pow_1[i - 1] * p_1;
        }
        for (int i = 0; i < hash.length; i++) {
            hash[i] = (i == 0 ? 0 : hash[i - 1]) + (s[i] - '0') * pow[i];
            rev[n - 1 - i] = (i == 0 ? 0 : rev[n - i]) + (s[n - 1 - i] - '0')
                    * pow[i];
        }
        palindromity[0] = 1;
        long ans = 1;
        for (int i = 1; i < n; i++) {
            if (isPalindrom(i)) {
                palindromity[i] = palindromity[(i - 1) / 2] + 1;
                ans += palindromity[i];
            }
        }
        out.println(ans);
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class D {
    BufferedReader in;
    StringTokenizer st;
    PrintWriter out;

    void solve() throws IOException {
        char[] s = next().toCharArray();
        long hashStart = 0, hashEnd = 0;
        long multiple = BigInteger.valueOf(100000000000000L).nextProbablePrime().longValue();
        long multiplePow = 1;

        int[] a = new int[s.length];
        long sum = 0;
        for (int length = 1; length <= s.length; ++length) {
            hashStart *= multiple;
            hashStart += s[length - 1];
            hashEnd += multiplePow * s[length - 1];
            multiplePow *= multiple;
            if (hashStart == hashEnd) {
                if (length == 1) {
                    a[length - 1] = 1;
                } else {
                    a[length - 1] = 1 + a[length / 2 - 1];
                }
            }
            sum += a[length - 1];
        }
        out.println(sum);
    }

    public void run() throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        eat("");
        solve();
        out.close();
        in.close();
    }

    void eat(String s) {
        st = new StringTokenizer(s);
    }

    String next() throws IOException {
        while (!st.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null) {
                return null;
            }
            eat(line);
        }
        return st.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public static void main(String[] args) throws IOException {
        new D().run();
    }
}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.Arrays;
import java.util.Locale;
import java.util.Scanner;

public class Main implements Runnable {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new Thread(new Main()).start();
	}

	public void run() {
		Locale.setDefault(Locale.US);
		try {
			run1();
		} catch (IOException e) {
			throw new RuntimeException();
		}
	}

	int nextInt(StreamTokenizer st) throws IOException {
		st.nextToken();
		return (int) st.nval;
	}

	double nextDouble(StreamTokenizer st) throws IOException {
		st.nextToken();
		return st.nval;
	}

	String nextLine(StreamTokenizer st) throws IOException {
		st.nextToken();
		return st.sval;
	}

	public void run1() throws IOException {
		// Scanner sc = new Scanner(new InputStreamReader(System.in));
		// Scanner sc = new Scanner(new File("input.txt"));
//		BufferedReader br = new BufferedReader(new FileReader("input.txt"));
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String s = br.readLine();
		long pow1 = 1;
		long pow2 = 1;
		long mod1 = 1235413512l;
		long mod2 = 123458712364l;
		int n = s.length();
		boolean[] isp = new boolean[n + 1];
		int[] res = new int[n + 1];
		long hl1 = 0;
		long hl2 = 0;
		long hr1 = 0;
		long hr2 = 0;
		for (int i = 0; i < n; i++) {
			hr1 *= mod1;
			hr2 *= mod2;
			hr1 += s.charAt(i);
			hr2 += s.charAt(i);
			hl1 += pow1 * s.charAt(i);
			hl2 += pow2 * s.charAt(i);
			pow1 *= mod1;
			pow2 *= mod2;
			if (hr1 == hl1 && hr2 == hl2) {
				isp[i + 1] = true;
			}
		}
		long r = 0;
		for (int i = 1; i <= n; i++) {
			if (isp[i])
				r += (res[i] = 1 + res[i / 2]);
		}
		System.out.println(r);
	}
}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.Arrays;
import java.util.Locale;
import java.util.Scanner;

public class Main implements Runnable {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new Thread(new Main()).start();
	}

	public void run() {
		Locale.setDefault(Locale.US);
		try {
			run1();
		} catch (IOException e) {
			throw new RuntimeException();
		}
	}

	int nextInt(StreamTokenizer st) throws IOException {
		st.nextToken();
		return (int) st.nval;
	}

	double nextDouble(StreamTokenizer st) throws IOException {
		st.nextToken();
		return st.nval;
	}

	String nextLine(StreamTokenizer st) throws IOException {
		st.nextToken();
		return st.sval;
	}

	public void run1() throws IOException {
		// Scanner sc = new Scanner(new InputStreamReader(System.in));
		// Scanner sc = new Scanner(new File("input.txt"));
//		BufferedReader br = new BufferedReader(new FileReader("input.txt"));
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String s = br.readLine();
		long pow1 = 1;
		long pow2 = 1;
		long mod1 = 1235413511l;
		long mod2 = 123458712361l;
		int n = s.length();
		boolean[] isp = new boolean[n + 1];
		int[] res = new int[n + 1];
		long hl1 = 0;
		long hl2 = 0;
		long hr1 = 0;
		long hr2 = 0;
		for (int i = 0; i < n; i++) {
			hr1 *= mod1;
			hr2 *= mod2;
			hr1 += s.charAt(i);
			hr2 += s.charAt(i);
			hl1 += pow1 * s.charAt(i);
			hl2 += pow2 * s.charAt(i);
			pow1 *= mod1;
			pow2 *= mod2;
			if (hr1 == hl1 && hr2 == hl2) {
				isp[i + 1] = true;
			}
		}
		long r = 0;
		for (int i = 1; i <= n; i++) {
			if (isp[i])
				r += (res[i] = 1 + res[i / 2]);
		}
		System.out.println(r);
	}
}


import static java.lang.Math.*;
import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;
import static java.lang.System.arraycopy;
import static java.util.Arrays.sort;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.fill;
import java.util.*;
import java.io.*;
import java.math.BigInteger;

public class Main {

	public static void main(String[] args) throws IOException {
		try {
			if (new File("input.txt").exists())
				System.setIn(new FileInputStream("input.txt"));
		} catch (SecurityException e) {
		}
		new Main().run();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");

	Random rnd = new Random(3651761);

	long[] map = new long[256];

	{
		for (int i = 0; i < 256; i++)
			map[i] = rnd.nextLong();
	}

	long base = BigInteger.probablePrime(30, rnd).longValue();

	private void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		char[] s = nextLine().toCharArray();
		int n = s.length;
		long[] pows = new long[n];
		pows[0] = 1;
		for (int i = 1; i < n; i++)
			pows[i] = pows[i - 1] * base;
		long[] revs = new long[n];
		long hash = 0;
		int nd2 = n / 2;
		for (int i = n - 1; i >= n - nd2; i--) {
			hash = hash * base + map[s[i]];
		}
		revs[n - 1] = hash;
		int curLen = nd2;
		for (int i = n - 2; i > 0; i--) {
			hash -= pows[curLen - 1] * map[s[i + 1]];
			if ((i & 1) == 0)
				curLen--;
			else
				hash = hash * base + map[s[i - curLen + 1]];
			revs[i] = hash;
		}
		int[] degs = new int[n];
		degs[0] = 1;
		long res = 1;
		hash = 0;
		for (int i = 1; i < n; i++) {
			if ((i & 1) == 1)
				hash = hash * base + map[s[i >> 1]];
			if (hash == revs[i])
				degs[i] = degs[(i - 1) >> 1] + 1;
			res += degs[i];
		}
		out.println(res);
		in.close();
		out.close();
	}

	void chk(boolean b) {
		if (b)
			return;
		System.out.println(new Error().getStackTrace()[1]);
		exit(999);
	}
	void deb(String fmt, Object... args) {
		System.out.printf(Locale.US, fmt + "%n", args);
	}
	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}
	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}
	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
	String nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}
	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}
}


import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;

public class d {

	int n;
	int[] d1, d2;

	private void solve() throws Exception {
		char[] c = nextToken().toCharArray();
		n = c.length;

		d1 = new int[n]; d2 = new int[n];
		int l = 0, r = -1;
		for (int i = 0; i < n; ++i) {
			int k = (i > r ? 0 : Math.min (d1[l + r - i], r - i)) + 1;
			while (i + k < n && i - k >= 0 && c[i + k] == c[i - k])
				++k;
			d1[i] = --k;
			if (i + k > r){
				l = i - k;
				r = i + k;
			}
		}
		l = 0; r = -1;
		for (int i = 0; i < n; ++i) {
			int k = (i > r ? 0 : Math.min (d2[l + r - i + 1], r - i + 1)) + 1;
			while (i + k - 1 < n && i - k >= 0 && c[i + k - 1] == c[i - k])
				++k;
			d2[i] = --k;
			if (i + k - 1 > r){
				l = i - k;
				r = i + k - 1;
			}
		}

		int[] res = new int[n];
		res[0] = 1;
		for (int i = 1; i < n; ++i)
			if (isPali(i))
				res[i] = res[(i + 1) / 2 - 1] + 1;
		long sum = 0;
		for (int i : res)
			sum += i;
		out.print(sum);
	}

	private boolean isPali(int num) {
		if (num % 2 == 0){
			return d1[num / 2] == num / 2;
		}
		else{
			return d2[num / 2 + 1] == num / 2 + 1;
		}
	}

	public void run() {
		try {
			solve();
		} catch (Exception e) {
			NOO(e);
		} finally {
			out.close();
		}
	}

	PrintWriter out;
	BufferedReader in;
	StringTokenizer St;

	void NOO(Exception e) {
		e.printStackTrace();
		System.exit(1);
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	long nextLong() {
		return Long.parseLong(nextToken());
	}

	double nextDouble() {
		return Double.parseDouble(nextToken());
	}

	String nextToken() {
		while (!St.hasMoreTokens()) {
			try {
				String line = in.readLine();
				St = new StringTokenizer(line);
			} catch (Exception e) {
				NOO(e);
			}
		}
		return St.nextToken();
	}

	private d(String name) {
		try {
			in = new BufferedReader(new FileReader(name + ".in"));
			St = new StringTokenizer("");
			out = new PrintWriter(new FileWriter(name + ".out"));
		} catch (Exception e) {
			NOO(e);
		}
	}

	private d() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			St = new StringTokenizer("");
			out = new PrintWriter(System.out);
		} catch (Exception e) {
			NOO(e);
		}
	}

	public static void main(String[] args) {
		new d().run();
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class D7 {

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = 0, w;
        char[]s = new char[(int) 5e6];
        while (true) {
            w = br.read();
            if (w==13)
                break;
            s[n++] = (char) w;
        }
        long[]pow = new long[n];
        pow[0] = 1;
        for (int i = 1; i < n; i++) {
            pow[i] = pow[i-1] * 67;
        }
        long[]Hash1 = new long[n], Hash2 = new long[n];
        Hash1[0] = get_code(s[0]);
        Hash2[n-1] = get_code(s[n-1]);
        for (int i = 1; i < n; i++) {
            Hash1[i] = Hash1[i-1]+get_code(s[i]) * pow[i];
            Hash2[n-i-1] = Hash2[n-i]+get_code(s[n-i-1]) * pow[i];
        }
        int[]degree_pal = new int[n];
        long ans = 1;
        degree_pal[0] = 1;
        for (int i = 1; i < n; i++) {
            long H = Hash2[i-(i-1)/2];
            if (i != n-1) {
                H -= Hash2[i+1];
            }
            if (H == Hash1[(i-1)/2] * pow[n-i-1]) {
                degree_pal[i] = degree_pal[(i-1)/2]+1;
                ans += degree_pal[i];
            }
        }
        System.out.println(ans);
    }

    private static long get_code(char a) {
        int c = (int) a;
        if (c <= 57)
            return c-47;
        if (c <= 90)
            return c-54;
        return c-60;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class D7 {

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = 0, w;
        char[]s = new char[(int) 5e6];
        while (true) {
            w = br.read();
            if (w==13)
                break;
            s[n++] = (char) w;
        }
        long[]pow = new long[n];
        pow[0] = 1;
        for (int i = 1; i < n; i++) {
            pow[i] = pow[i-1] * 67;
        }
        long[]Hash = new long[n];
        Hash[0] = get_code(s[0]);
        for (int i = 1; i < n; i++) {
            Hash[i] = Hash[i-1]+get_code(s[i]) * pow[i];
        }
        int[]degree_pal = new int[n];
        long ans = 1;
        degree_pal[0] = 1;
        for (int i = 1; i < n; i++) {
            if (Hash[i]-Hash[i-(i-1)/2-1]==Hash[(i-1)/2]*pow[i-(i-1)/2]) {
                degree_pal[i] = degree_pal[(i-1)/2]+1;
                ans += degree_pal[i];
            }
        }
        System.out.println(ans);
    }

    private static long get_code(char a) {
        int c = (int) a;
        if (c <= 57)
            return c-47;
        if (c <= 90)
            return c-54;
        return c-60;
    }
}


import java.util.*;
import static java.lang.System.*;

public class D {
    static String s;
    static int n;
    static final int MAX_N = 6000000;
    final static long[] hash1 = new long[MAX_N];
    final static long[] hash2= new long[MAX_N];
    final static long[] pw = new long[MAX_N];
    final static int[] dp = new int[MAX_N];
//    final static int C = 237733;
    final static int C = 12009;

    static void solve(){
        int res = 0;

        n = s.length();

        pw[0] = 1;
        for(int i=1;i<n;i++) pw[i] = pw[i-1] * C;

        // s[0,0]=""
        hash1[0] = 0;
        for(int i=0;i<n;i++) hash1[i+1] = hash1[i]*C + s.charAt(i);
        hash2[0] = 0;
        for(int i=0;i<n;i++) hash2[i+1] = hash2[i]*C + s.charAt(n-1-i);

//        out.println(Arrays.toString(hash1));
//        out.println(Arrays.toString(hash2));

        dp[0] = 0;
        for(int i=1;i<=n;i++){
            int len = i/2;
            if( hash1[len] != hash2[n-(i-len)] - hash2[n-i]*pw[len] ) { dp[i] = 0; continue; }

            dp[i] = dp[len]+1;
            res += dp[i];
        }

        out.println(res);
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(in);
        s = sc.nextLine();
        solve();
    }
}


import java.util.*;
import java.io.*;
import static java.lang.System.*;

public class D {
    static String s;
    static int n;
    static final int MAX_N = 5000001;
    final static long[] hash1 = new long[MAX_N];
    final static long[] hash2= new long[MAX_N];
    final static long[] pw = new long[MAX_N];
    final static int[] dp = new int[MAX_N];
//    final static int C = 237733;
    final static int C = 12009;

    static void solve(){
        int res = 0;

        n = s.length();

        pw[0] = 1;
        for(int i=1;i<n;i++) pw[i] = pw[i-1] * C;

        // s[0,0]=""
        hash1[0] = 0;
        for(int i=0;i<n;i++) hash1[i+1] = hash1[i]*C + s.charAt(i);
        hash2[0] = 0;
        for(int i=0;i<n;i++) hash2[i+1] = hash2[i]*C + s.charAt(n-1-i);

//        out.println(Arrays.toString(hash1));
//        out.println(Arrays.toString(hash2));

        dp[0] = 0;
        for(int i=1;i<=n;i++){
            int len = i/2;
            if( hash1[len] != hash2[n-(i-len)] - hash2[n-i]*pw[len] ) { dp[i] = 0; continue; }

            dp[i] = dp[len]+1;
            res += dp[i];
        }

        out.println(res);
    }
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(in));
        s = br.readLine();
        solve();
    }
}


import java.util.*;
import static java.lang.System.*;

public class D {
    static String s;
    static int n;
    static final int MAX_N = 6000000;
    final static long[] hash1 = new long[MAX_N];
    final static long[] hash2= new long[MAX_N];
    final static long[] pw = new long[MAX_N];
    final static int[] dp = new int[MAX_N];
    final static int C = 237733;

    static void solve(){
        int res = 0;

        n = s.length();

        pw[0] = 1;
        for(int i=1;i<n;i++) pw[i] = pw[i-1] * C;

        // s[0,0]=""
        hash1[0] = 0;
        for(int i=0;i<n;i++) hash1[i+1] = hash1[i]*C + s.charAt(i);
        hash2[0] = 0;
        for(int i=0;i<n;i++) hash2[i+1] = hash2[i]*C + s.charAt(n-1-i);

//        out.println(Arrays.toString(hash1));
//        out.println(Arrays.toString(hash2));

        dp[0] = 0;
        for(int i=1;i<=n;i++){
            int len = i/2;
            if( hash1[len] != hash2[n-(i-len)] - hash2[n-i]*pw[len] ) { dp[i] = 0; continue; }

            dp[i] = dp[len]+1;
            res += dp[i];
        }

        out.println(res);
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(in);
        s = sc.nextLine();
        solve();
    }
}


import java.util.*;
import java.io.*;
import static java.lang.System.*;

public class D {
    static String s;
    static int n;
    static final int MAX_N = 5000001;
    final static int[] hash1 = new int[MAX_N];
    final static int[] hash2 = new int[MAX_N];
    final static int[] pw = new int[MAX_N];
    final static int[] dp = new int[MAX_N];
//    final static int C = 237733;
    final static int C = 12009;

    static void solve(){
        int res = 0;

        n = s.length();

        pw[0] = 1;
        for(int i=1;i<n;i++) pw[i] = pw[i-1] * C;

        // s[0,0]=""
        hash1[0] = 0;
        for(int i=0;i<n;i++) hash1[i+1] = hash1[i]*C + s.charAt(i);
        hash2[0] = 0;
        for(int i=0;i<n;i++) hash2[i+1] = hash2[i]*C + s.charAt(n-1-i);

        dp[0] = 0;
        for(int i=1;i<=n;i++){
            int len = i/2;
            if( hash1[len] != hash2[n-(i-len)] - hash2[n-i]*pw[len] ) { dp[i] = 0; continue; }

            dp[i] = dp[len]+1;
            res += dp[i];
        }

        out.println(res);
    }
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(in));
        s = br.readLine();
        solve();
    }
}


import java.util.*;
import java.io.*;
import static java.lang.System.*;

public class D {
    static String s;
    static int n;
    static final int MAX_N = 6000000;
    final static long[] hash1 = new long[MAX_N];
    final static long[] hash2= new long[MAX_N];
    final static long[] pw = new long[MAX_N];
    final static int[] dp = new int[MAX_N];
//    final static int C = 237733;
    final static int C = 12009;

    static void solve(){
        int res = 0;

        n = s.length();

        pw[0] = 1;
        for(int i=1;i<n;i++) pw[i] = pw[i-1] * C;

        // s[0,0]=""
        hash1[0] = 0;
        for(int i=0;i<n;i++) hash1[i+1] = hash1[i]*C + s.charAt(i);
        hash2[0] = 0;
        for(int i=0;i<n;i++) hash2[i+1] = hash2[i]*C + s.charAt(n-1-i);

//        out.println(Arrays.toString(hash1));
//        out.println(Arrays.toString(hash2));

        dp[0] = 0;
        for(int i=1;i<=n;i++){
            int len = i/2;
            if( hash1[len] != hash2[n-(i-len)] - hash2[n-i]*pw[len] ) { dp[i] = 0; continue; }

            dp[i] = dp[len]+1;
            res += dp[i];
        }

        out.println(res);
    }
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(in));
        s = br.readLine();
        solve();
    }
}


import java.util.*;
import static java.lang.System.*;

public class D {
    static String s;
    static int n;
    static long[] hash1, hash2;
    static long[] pw;
    static int[] dp;
    static final int C = 237733;
    //static final int MAX_N = 6000000;

    static void solve(){
        int res = 0;

        n = s.length();
        hash1 = new long[n+1];
        hash2 = new long[n+1];
        pw = new long[n+1];
        dp = new int[n+1];

        pw[0] = 1;
        for(int i=1;i<n;i++) pw[i] = pw[i-1] * C;

        // s[0,0]=""
        hash1[0] = 0;
        for(int i=0;i<n;i++) hash1[i+1] = hash1[i]*C + s.charAt(i);
        hash2[0] = 0;
        for(int i=0;i<n;i++) hash2[i+1] = hash2[i]*C + s.charAt(n-1-i);

//        out.println(Arrays.toString(hash1));
//        out.println(Arrays.toString(hash2));

        dp[0] = 0;
        for(int i=1;i<=n;i++){
            int len = i/2;
            if( hash1[len] != hash2[n-(i-len)] - hash2[n-i]*pw[len] ) { dp[i] = 0; continue; }

            dp[i] = dp[len]+1;
            res += dp[i];
        }

        out.println(res);
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(in);
        s = sc.nextLine();
        solve();
    }
}