Problem: Max wants to buy a new skateboard. He has calculated the amount of money that is needed to buy a new skateboard. He left a calculator on the floor and went to ask some money from his parents. Meanwhile his little brother Yusuf came and started to press the keys randomly. Unfortunately Max has forgotten the number which he had calculated. The only thing he knows is that the number is divisible by 4.

You are given a string s consisting of digits (the number on the display of the calculator after Yusuf randomly pressed the keys). Your task is to find the number of substrings which are divisible by 4. A substring can start with a zero.

A substring of a string is a nonempty sequence of consecutive characters.

For example if string s is 124 then we have four substrings that are divisible by 4: 12, 4, 24 and 124. For the string 04 the answer is three: 0, 4, 04.

As input/output can reach huge size it is recommended to use fast input/output methods: for example, prefer to use gets/scanf/printf instead of getline/cin/cout in C++, prefer to use BufferedReader/PrintWriter instead of Scanner/System.out in Java.

Input

The only line contains string s (1 ≤ |s| ≤ 3·105). The string s contains only digits from 0 to 9.

Output

Print integer a — the number of substrings of the string s that are divisible by 4.

Note that the answer can be huge, so you should use 64-bit integer type to store it. In C++ you can use the long long integer type and in Java you can use long integer type.

Examples

Input

124


Output

4


Input

04


Output

3


Input

5810438174


Output

9

Solution (in JAVA):

Solution:
import java.util.*;

public class Example {
    static long[][] dp;
    //  static    int[]  ar;
    static int mod = 1000000000 + 7;
    static long[] ans = new long[100000 + 1];
    static  List<List<Integer>> adj;
    static  int[] vis;
    static int[]  dis;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 4,8,15,16,23,42.i
   String s=sc.next();
   StringBuilder ss= new StringBuilder(s);
   ss.reverse();
   s=ss.toString();
   int n =s.length()-1;
   long ans=0;
     //   System.out.println(s);
   for(int i=0;i<s.length()-1;i++){
       int c1=Integer.parseInt(String.valueOf(s.charAt(i)));
       int c2=Integer.parseInt(String.valueOf(s.charAt(i+1)));
       if(c1%4==0) {
           ans++;
       }

       int aa=c2*10+c1;
       if(aa%4==0){
           ans+=(n-(i+1)+1);
       }


   }
        int c1=Integer.parseInt(String.valueOf(s.charAt(n)));
   if(c1%4==0)
       ans++;
        System.out.println(ans);























    }

    private static long findans(int[] arr, int i, int s) {
        if(i<0 && s==0)
            return 0;
        if(i<0 && s==1)
            return 0;
        if(dp[i][s]!=-1){
            return dp[i][s];
        }
        else{


            if(s==0)
                return dp[i][s]= Math.max(findans(arr,i-1,s),-1*arr[i]+findans(arr,i-1,1-s));
            else
                return dp[i][s]= Math.max(findans(arr,i-1,s),arr[i]+findans(arr,i-1,1-s));
        }
    }

    public static void dfs(int v,int di){
        dis[v]=di;
        vis[v]=1;
        for(int i=0;i<adj.get(v).size();i++){
            int x=adj.get(v).get(i);
            if(vis[x]==0){
                dfs(x,di+1);
            }
        }
    }

    private static boolean isPrime(long a) {
        if (a == 1)
            return true;

        for (int i = 2; i * i <= a; i++) {
            if (a % i == 0)
                return false;

        }
        return true;
    }

    private static int gcd(int aa, int bb) {
        if (bb == 0)
            return aa;
        return gcd(bb, aa % bb);

    }

    private static int lowerBound(int[] ar, int a) {
        int res = 0;
        int s = 1;
        int e = ar.length - 1;
        while (s <= e) {
            int mid = (s) + (e - s) / 2;
            if (ar[mid] <= a) {
                res = mid;
                s = mid + 1;

            } else {
                e = mid - 1;
            }
        }
        return res;
    }

    public static int getXORSum(int[] arr1, int[] arr2) {

        long c = 0;
        int n = arr1.length;
        int m = arr2.length;
        if (n == 1 && m == 1) {
            return arr1[0] & arr2[0];
        }
        int aa = n + m;
        for (int i = 0; i < 32; i++) {

            int z = 0;
            int o = 0;
            int cc = 0;
            for (int a : arr1) {


                int x = (a & (1 << i));
                if (x == 0)
                    z++;
                else
                    o++;


            }
            for (int a : arr2) {
                int x = (a & (1 << i));
                if (x == 0)
                    z++;
                else
                    o++;
            }

            System.out.println(z + " " + o);

            if (z != aa && o != aa) {
                c = c + (1 << i);

            }


        }
        return (int) c;


    }


}