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:
//package Java;
import java.io.*;
import java.util.*;
import java.util.Map.Entry;
public class Main {	
		public static void main(String[] args) throws IOException{  
//			   Scanner sc =new Scanner(System.in);
//			   String s=sc.next();
			BufferedReader inp = new BufferedReader (new InputStreamReader(System.in));
			String s = inp.readLine();
		       int n=s.length();long ans=0;
		       for(int i=0;i<n-1;i++) {
		    	   if(Integer.valueOf(s.substring(i,i+2))%4==0){
		    		   ans+=(1+i);
		    	   }
		       }
		       for(int i=0;i<n;i++) {
		    	   if((s.charAt(i)-'0')%4==0) {
		    		   ans++;
		    	   }
		       }
		       System.out.println(ans);
        }
		static void add(int a[]) {
			for(int i=0;i<a.length;i++) {
				a[i]*=10;
			}
		}
		
		
		
	     static void isKthBitSet(int n, int k) { 
			if ((n & (1 << (k - 1))) > 0) 
			System.out.print("SET"); 
			else
			System.out.print("NOT SET"); 
			
		 } 
		
		 static int octaltodecimal(int deciNum)
		    {
		        int octalNum = 0, countval = 1;
		        int dNo = deciNum;
		        while (deciNum != 0) {
		 
		            // decimals remainder is calculated
		            int remainder = deciNum % 8;
		 
		            // storing the octalvalue
		            octalNum += remainder * countval;
		 
		            // storing exponential value
		            countval = countval * 10;
		            deciNum /= 8;
		        }
		       return octalNum;
		    }
		
	  public static int floorSqrt(int x) 
	    { 
	        // Base Cases 
	        if (x == 0 || x == 1) 
	            return x; 
	  
	        // Do Binary Search for floor(sqrt(x)) 
	        int start = 1, end = x, ans=0; 
	        while (start <= end) 
	        { 
	            int mid = (start + end) / 2; 
	  
	            // If x is a perfect square 
	            if (mid*mid == x) 
	                return mid; 
	  
	            // Since we need floor, we update answer when mid*mid is 
	            // smaller than x, and move closer to sqrt(x) 
	            if (mid*mid < x) 
	            { 
	                start = mid + 1; 
	                ans = mid; 
	            } 
	            else   // If mid*mid is greater than x 
	                end = mid-1; 
	        } 
	        return ans; 
	    } 
		static int div(int n,int b) {
			int g=-1;
			for(int i=2;i<=Math.sqrt(n);i++) {
				if(n%i==0&&i!=b) {
					g=i;
					break;
				}
			}
			return g;
		}
	 
	  
	  public static int gcd(int a, int b) 
	    { 
	        if (a == 0) 
	            return b; 
	          
	        return gcd(b%a, a); 
	    } 
	   public static int lcm(int a, int b)  
	  {  
	     return (a*b)/gcd(a, b);  
	  }  
	   public static boolean isPrime1(int n) {
           if (n <= 1) {
               return false;
           }
           if (n == 2) {
               return true;
           }
           for (int i = 2; i <= Math.sqrt(n) + 1; i++) {
               if (n % i == 0) {
                   return false;
               }
           }
           return true;
       }
       public static boolean isPrime(int n) {
           if (n <= 1) {
               return false;
           }
           if (n == 2) {
               return true;
           }
           if (n % 2 == 0) {
               return false;
           }
           for (int i = 3; i <= Math.sqrt(n) + 1; i = i + 2) {
               if (n % i == 0) {
                   return false;
               }
           }
           return true;
       }
	      
	
}