You visit a doctor on a date given in the format $yyyy:mm:dd$. Your doctor suggests you to take pills every alternate day starting from that day. You being a forgetful person are pretty sure won’t be able to remember the last day you took the medicine and would end up in taking  the medicines on wrong days. 
So you come up with the idea of taking medicine on the dates whose day is odd or even depending on whether $dd$ is odd or even. Calculate the number of pills you took on right time before messing up for the first time.

-----Note:-----
Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100; the centurial years that are exactly divisible by 400 are still leap years. For example, the year 1900 is not a leap year; the year 2000 is a leap year.

-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow. 
- Each testcase contains of a single line of input, in the format $yyyy:mm:dd$

-----Output:-----
For each testcase, output in a single line the required answer.

-----Constraints-----
- $ 1 \leq T \leq 1000 $
- $ 1900 \leq yyyy \leq 2038 $
- $yyyy:mm:dd$ is a valid date

-----Sample Input:-----
1
2019:03:31

-----Sample Output:-----
1

-----EXPLANATION:-----
You can take pill on the right day only on 31st March. Next you will take it on 1st April which is not on the alternate day.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'for _ in range(int(input())):\n EVEN=[4,6,9,11]\n ODD=[1,3,5,7,8,10,12]\n Y,M,D=list(map(int,input().strip().split(":")))\n Ans=0\n if Y%400==0 or (Y%4==0 and Y%100!=0):\n  ODD.append(2)\n  if M in EVEN:\n   if D%2==0:\n    Ans=(((30-D)//2)+1)+15\n   else:\n    Ans=(((30-D)//2)+1)+16\n  elif M in ODD:\n   if D%2==0:\n    if M==2:\n     Ans=(((29-D)//2)+1)\n    else:\n     Ans=(((31-D)//2)+1)\n   else:\n    if M==2:\n     Ans=(((29-D)//2)+1)\n    else:\n     Ans=(((31-D)//2)+1)\n else:\n  EVEN.append(2)\n  if M in ODD:\n   if D%2==0:\n    Ans=(((31-D)//2)+1)\n   else:\n    Ans=(((31-D)//2)+1)\n  elif M in EVEN:\n   if D%2==0:\n    if M==2:\n     Ans=(((28-D)//2)+1)+15\n    else:\n     Ans=(((30-D)//2)+1)+15\n   else:\n    if M==2:\n     Ans=(((28-D)//2)+1)+16\n    else:\n     Ans=(((30-D)//2)+1)+16\n print(Ans)\n \n  \n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13607