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
from sys import stdin
from collections import defaultdict
from copy import deepcopy

def rei():
    return list(map(int, stdin.readline().strip().split(' ')))
def res():
    return stdin.readline().rstrip()

def prno(): print('NO')

def pryes(): print('YES')

def solve():
    nums=list(map(int, list(res())))
    print(nums)
    make=set()
    ans=0
    for d in nums:
        cmake=set()
        rest=d%4
        if rest==0: ans+=1
        cmake.add(rest)
        for r in make:
            rest=(r*10+d)%4
            if rest==0: ans+=1
            cmake.add(rest)
        make=cmake
    print(ans)
if __name__ == '__main__':
    solve()