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.
The only line contains string *s* (1 ≤ |*s*| ≤ 3·10<sup class="upper-index">5</sup>). The string *s* contains only digits from 0 to 9.
none
124
4
04
3
5810438174
9
1
0
039
1
97247
6
5810438174
9
12883340691714056185860211260984431382156326935244
424
2144315253572020279108092911160072328496568665545836825277616363478721946398140227406814602154768031
1528
80124649014054971081213608137817466046254652492627741860478258558206397113198232823859870363821007188476405951611069347299689170240023979048198711745011542774268179055311013054073075176122755643483380248999657649211459997766221072399103579977409770898200358240970169892326442892826731631357561876251276209119521202062222947560634301788787748428236988789594458520867663257476744168528121470923031438015546006185059454402637036376247785881323277542968298682307854655591317046086531554595892680980142608
30826
123456
7
4
1
123
1

#  If you win, you live. You cannot win unless you fight.

from sys import stdin
input=stdin.readline
import heapq
import string
rd=lambda: map(lambda s: int(s), input().strip().split())
ri=lambda: int(input())
rs=lambda :input().strip()
from collections import defaultdict as unsafedict,deque,Counter as unsafeCounter
from bisect import bisect_left as bl, bisect_right as br
from random import randint
from math import gcd, floor,log2,factorial,radians,sin,cos
random = randint(1, 10 ** 9)
mod=10**9+7
def ceil(a,b):
	return (a+b-1)//b
class myDict:
	def __init__(self,func):
		self.RANDOM = randint(0,1<<32)
		self.default=func
		self.dict={}
	def __getitem__(self,key):
		myKey=self.RANDOM^key
		if myKey not in self.dict:
			self.dict[myKey]=self.default()
		return self.dict[myKey]
	def get(self,key,default):
		myKey=self.RANDOM^key
		if myKey not in self.dict:
			return default
		return self.dict[myKey]
	def __setitem__(self,key,item):
		myKey=self.RANDOM^key
		self.dict[myKey]=item
	def getKeys(self):
		return [self.RANDOM^i for i in self.dict]
	def __str__(self):
		return f'{[(self.RANDOM^i,self.dict[i]) for i in self.dict]}'


s=rs()
cnt=int(s[0])%4==0
for i in range(1,len(s)):
	if int(s[i])%4==0:
		cnt+=1
	if int(s[i-1]+s[i])%4==0:
		cnt+=(i)
print(int(cnt))
