You have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).
In how many ways can we select some of these coins so that they are X yen in total?
Coins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.

-----Constraints-----
 - 0 \leq A, B, C \leq 50
 - A + B + C \geq 1
 - 50 \leq X \leq 20 000
 - A, B and C are integers.
 - X is a multiple of 50.

-----Input-----
Input is given from Standard Input in the following format:
A
B
C
X

-----Output-----
Print the number of ways to select coins.

-----Sample Input-----
2
2
2
100

-----Sample Output-----
2

There are two ways to satisfy the condition:
 - Select zero 500-yen coins, one 100-yen coin and zero 50-yen coins.
 - Select zero 500-yen coins, zero 100-yen coins and two 50-yen coins.
[{"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\n\nans = 0\n\nfor i in range(a + 1):\n    for j in range(b + 1):\n        maisuuOf50 = (x - i * 500 - j * 100) / 50\n        if 0 <= maisuuOf50 <= c:\n            ans += 1\n\nprint(ans)\n", "passed": true, "time": 0.17, "memory": 14260.0, "status": "done"}, {"code": "def main():\n\n    five_hundred = int(input())\n    one_hundred = int(input())\n    fifty = int(input())\n    x = int(input())\n    ans = 0\n    for i in range(five_hundred + 1):\n        for j in range(one_hundred + 1):\n            for k in range(fifty + 1):\n                if 500 * i + 100 * j + 50 * k == x:\n                    ans += 1\n\n    print(ans)\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.16, "memory": 14124.0, "status": "done"}, {"code": "s=[int(input()) for _ in range(3)]\nA,B,C=s\nX=int(input())\n\ncnt=0\nfor i in range(A+1):\n    for j in range(B+1):\n        for k in range(C+1):\n            tmp=500*i+100*j+50*k\n            if tmp==X:\n                cnt+=1\n\nprint(cnt)", "passed": true, "time": 1.69, "memory": 14116.0, "status": "done"}, {"code": "# -*- coding:utf-8 -*-\nA = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\ncnt = 0\nrest_X = 0\n\nfor i in range(0,A+1):\n    rest_X = X - 500*i\n    if rest_X == 0:\n        cnt+=1\n        break\n    elif rest_X < 0:\n        break\n    for j in range(0,B+1):\n        rest_X = X - 500*i\n        rest_X = rest_X - (100*j)\n        if rest_X == 0:\n            cnt+=1\n            break\n        elif rest_X < 0:\n            break\n        \n        if 50*C >= rest_X:\n            cnt+=1\n\nprint(cnt)", "passed": true, "time": 0.3, "memory": 14132.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\ncnt = 0\nfor i in range(0,A+1):\n    for j in range(0,B+1):\n        for k in range(0,C+1):\n            price = 500 * i + 100 * j + 50 * k\n            if price == X:\n                cnt += 1\nprint(cnt)", "passed": true, "time": 0.17, "memory": 14300.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\n\nans = 0\nfor i in range(a + 1):\n    for j in range(b + 1):\n        for k in range(c + 1):\n            if 500 * i + 100 * j + 50 * k == x:\n                ans += 1\nprint(ans)", "passed": true, "time": 1.79, "memory": 14152.0, "status": "done"}, {"code": "a, b, c, x = map(int, [input() for i in range(4)])\nans = 0\nfor i in range(a+1):\n  for j in range(b+1):\n    for k in range(c+1):\n      if i * 500 + j * 100 + k * 50 == x:\n        ans += 1\nprint(ans)", "passed": true, "time": 0.21, "memory": 14084.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\n\nans = 0\nfor aa in range(a + 1):\n    for bb in range(b + 1):\n        for cc in range(c + 1):\n            if 500 * aa + 100 * bb + 50 * cc == x:\n                ans += 1\nprint(ans)", "passed": true, "time": 0.17, "memory": 14328.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\ncount = 0\n\nfor i in range(A+1):\n    for j in range(B+1):\n        for k in range(C+1):\n            if 500*i +100*j + 50*k == X:\n                count += 1\n\nprint(\"{}\".format(count))", "passed": true, "time": 0.21, "memory": 14100.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\n\ncnt = 0\nfor i in range(a+1):\n  for j in range(b+1):\n    for k in range(c+1):\n      if 500 * i + 100 * j + 50 * k == x:\n        cnt += 1\n        \nprint(cnt)", "passed": true, "time": 0.24, "memory": 14252.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\n\nans = 0\nfor i in range(a + 1):\n    for j in range(b + 1):\n        for k in range(c + 1):\n            if i * 500 + j * 100 + k * 50 == x:\n                ans += 1\n\nprint(ans)\n", "passed": true, "time": 0.2, "memory": 14120.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\n\ncnt = 0\n\nfor a_idx in range(a + 1):\n  for b_idx in range(b + 1):\n    for c_idx in range(c + 1):\n      total = 500 * a_idx + 100 * b_idx + 50 * c_idx\n      if (total == x): cnt += 1\n\nprint(cnt)", "passed": true, "time": 0.3, "memory": 14344.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\ncount = 0\n# for a in range(A+1):\n#     temp = X\n#     if temp - 500 * a == 0:\n#         count+=1\n#         break\n#     elif temp - 500 * a > 0:\n#         temp -= 500 * a\n\n#     for b in range(B+1):\n#         temp_b = temp\n#         if b != 0:\n#             if temp_b - 100 * b == 0:\n#                 count+=1\n#                 break\n#             elif temp_b - 100 * b > 0:\n#                 temp_b -= 100 * b\n\n#         if C > 0:\n#             temp_c = temp_b\n#             for c in range(1,C+1):\n#                 if temp_c - 50 == 0:\n#                     count+=1\n#                     break\n#                 temp_c -= 50\n#     if X < 500:\n#         break\nfor a in range(A+1):\n    for b in range(B+1):\n        for c in range(C+1):\n            total = 500 * a + 100 * b + 50 * c\n            if total == X:\n                count+=1\n\nprint(count)", "passed": true, "time": 0.22, "memory": 14088.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\nL = []\nfor a in range(A+1):\n    for b in range(B+1):\n        for c in range(C+1):\n            if 500*a + 100*b + 50*c == X:\n                L.append((a,b,c))\nprint((len(L)))\n\n\n\n", "passed": true, "time": 0.15, "memory": 14208.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\nprint(sum(500*a + 100*b + 50*c == X for a in range(A+1) for b in range(B+1) for c in range(C+1)))", "passed": true, "time": 0.15, "memory": 14196.0, "status": "done"}, {"code": "a=int(input())\nb=int(input())\nc=int(input())\nsum_=int(input())\ncount=0\n\nfor i in range(0,a+1):\n    for j in range(0,b+1):        \n        for k in range(0,c+1):\n            check=500*i+100*j+50*k\n            if(check==sum_):\n                count+=1\nprint(count)                \n", "passed": true, "time": 0.2, "memory": 14116.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\nans = 0\nfor i in range(a + 1):\n    for j in range(b + 1):\n        for k in range(c + 1):\n            if i * 500 + j * 100 + k * 50 == x:\n                ans += 1\nprint(ans)\n", "passed": true, "time": 0.16, "memory": 14220.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\ncnt = 0\n\nfor i in range(A+1):\n    for j in range(B+1):\n        for k in range(C+1):\n            Y = 500*i + 100*j + 50*k\n            if Y == X:\n                cnt += 1\n\nprint(cnt)", "passed": true, "time": 0.24, "memory": 14220.0, "status": "done"}, {"code": "def main():\n    a, b, c, x = (int(input())+1 for _ in range(4))\n    x -= 1\n\n    ans = 0\n    for i_a in range(a):\n        for i_b in range(b):\n            for i_c in range(c):\n                if i_a * 500 + i_b * 100 + i_c * 50 == x:\n                    ans += 1\n    print(ans)\n\n\nmain()", "passed": true, "time": 0.21, "memory": 14208.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\ncnt=0\nfor a in range(A+1):\n  for b in range(B+1):\n    for c in range(C+1):\n      if 500*a+100*b+50*c==X:\n        cnt += 1\n        \nprint(cnt)", "passed": true, "time": 0.16, "memory": 14108.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\nres = 0\nfor i in range(a+1):\n  for j in range(b+1):\n    for k in range(c+1):\n      if 500*i + 100*j + 50*k == x:\n        res += 1\nprint(res)", "passed": true, "time": 0.15, "memory": 14324.0, "status": "done"}, {"code": "A=int(input())\nB=int(input())\nC=int(input())\nX=int(input())\nans=0\nfor i in range(0,A+1):\n    for j in range(0,B+1):\n        for k in range(0,C+1):\n            if 500*i+100*j+50*k==X:\n                ans+=1\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14224.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\n\ncnt = 0\nfor i in range(a+1):\n    for j in range(b+1):\n        for k in range(c+1):\n            if 500 * i + 100 * j + 50 * k == x:\n                cnt += 1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14276.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\ncnt = 0\nfor a in range(A+1):\n  if X < 500*a:\n    continue\n  y = X-(500*a)\n  if y == 0:\n    cnt += 1\n    continue\n  for b in range(B+1):\n    if y < b*100:\n      continue\n    z = y-(100*b)\n    if z == 0:\n      cnt += 1\n      continue\n    for c in range(C+1):\n      w = z-(50*c)\n      if w == 0:\n        cnt += 1\n        break\nprint(cnt)", "passed": true, "time": 0.17, "memory": 14088.0, "status": "done"}, {"code": "A=int(input())\nB=int(input())\nC=int(input())\nX=int(input())\n\nans=0\nfor i in range(A+1):\n  for j in range(B+1):\n    for k in range(C+1):\n      if i*500+j*100+50*k==X:\n        ans+=1\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14360.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\nans = 0\nfor i in range(a + 1):\n    for j in range(b + 1):\n        for k in range(c + 1):\n            if i* 500 + j * 100 + k * 50 == x:\n                ans += 1\nprint(ans)", "passed": true, "time": 0.15, "memory": 14248.0, "status": "done"}, {"code": "a=int(input())\nb=int(input())\nc=int(input())\nx=int(input())\nif x%100>0 and c==0:\n    print((0))\n    return\nelse:\n    a=min(a,x//500)\n    b=min(b,x//100)\n    c=min(c, x // 50)\n    ans=0\n    for i in range(a+1):\n        for j in range(b+1):\n            for c in range(c+1):\n                if i*500+j*100+c*50==x:ans+=1\nprint(ans)\n", "passed": true, "time": 0.25, "memory": 14080.0, "status": "done"}, {"code": "A=int(input())\nB=int(input())\nC=int(input())\nX=int(input())\ncount=0\nfor i in range(A+1):\n    for j in range(B+1):\n        for k in range(C+1):\n            if 500*i+100*j+50*k==X:\n                count+=1\nprint(count)\n", "passed": true, "time": 0.15, "memory": 14344.0, "status": "done"}, {"code": "A = int(input()) + 1\nB = int(input()) + 1\nC = int(input()) + 1\nX = int(input())\n\ncount = 0\nfor a in range(A):\n    for b in range(B):\n        for c in range(C):\n            if a * 500 + b * 100 + c * 50 == X:\n                count += 1\n\nprint(count)", "passed": true, "time": 0.16, "memory": 14216.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\ncount = 0\nfor i in range(a+1):\n    for j in range(b+1):\n        for k in range(c+1):\n            if x ==  500 * i + 100 * j + 50 * k:\n                 count += 1\nprint(count)", "passed": true, "time": 0.15, "memory": 14092.0, "status": "done"}, {"code": "def answer(a: int, b: int, c: int, x: int) -> int:\n    count = 0\n    for i in range(0, a + 1):\n        for j in range(0, b + 1):\n            for k in range(0, c + 1):\n                if x == i * 500 + j * 100 + k * 50:\n                    count += 1\n\n    return count\n\n\ndef main():\n    a = int(input())\n    b = int(input())\n    c = int(input())\n    x = int(input())\n    print(answer(a, b, c, x))\n\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.17, "memory": 14396.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\ng = int(input())\ntmp = []\nfor x in range(a+1):\n    for y in range(b+1):\n        for z in range(c+1):\n            tmp.append(500*x + 100*y + 50*z)\nans = tmp.count(g)\nprint(ans)", "passed": true, "time": 0.25, "memory": 15864.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\nans = 0\nfor i in range(0, A+1):\n    for j in range(0, B+1):\n        for k in range(0, C+1):\n            if i*500 + j * 100 + k * 50 == X:\n                ans += 1\n\nprint(ans)\n\n\n\n", "passed": true, "time": 0.16, "memory": 14312.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\nans = 0\nfor i in range(a+1):\n  for j in range(b+1):\n    for k in range(c+1):\n      if 500*i+100*j+50*k == x:\n        ans += 1\nprint(ans)", "passed": true, "time": 0.15, "memory": 14324.0, "status": "done"}, {"code": "# coding: utf-8\n# Your code here!\n\na = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\n\nmax_a = min(int(x/500), a)\nmax_b = min(int(x/100), b)\nmax_c = min(int(x/50), c)\n\ncnt = 0\n\nfor i in range(max_a + 1) : \n    for j in range(max_b + 1) : \n        for k in range(max_c + 1) : \n            if i*500 + j*100 + k*50 == x : \n                cnt += 1\n                \nprint(cnt)", "passed": true, "time": 0.18, "memory": 14080.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\ncnt = 0\nfor i in range(a+1):\n    for j in range(b+1):\n        for ind in range(c+1):\n            if 500*i + 100*j + 50*ind == x:\n                cnt += 1\n\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14124.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\nans = 0\nfor a in range(A+1):\n    for b in range(B+1):\n        for c in range(C+1):\n            if(500*a + 100*b + 50*c) == X:\n                ans += 1\nprint(ans)\n", "passed": true, "time": 0.17, "memory": 14348.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\nans = 0\n\nfor i in range(0,A+1):\n  a = 500*i\n  \n  for j in range(0,B+1):\n    b = 100*j\n    \n    for k in range(0,C+1):\n      c = 50*k\n      \n      if a + b + c == X:\n        ans += 1\n        \nprint(ans)\n  \n", "passed": true, "time": 0.15, "memory": 14176.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nx = int(input())\nans = 0\n\nfor a in range(A+1):\n  for b in range(B+1):\n    for c in range(C+1):\n      if 500*a+100*b+50*c == x:\n        ans += 1\n\nprint(ans)", "passed": true, "time": 0.16, "memory": 14132.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\nans = 0\nfor i in range(a+1):\n  for j in range(b+1):\n    for k in range(c+1):\n      if 500*i + 100*j + 50*k == x:\n        ans += 1\nprint(ans)", "passed": true, "time": 0.24, "memory": 14248.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\ncount = 0\nfor a in range(A+1):\n    for b in range(B+1):\n        for c in range(C+1):\n            if 500*a + 100*b + 50*c == X:\n                count += 1\nprint(count)", "passed": true, "time": 0.15, "memory": 14312.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\ncnt = 0\nfor i in range(A+1):\n    for j in range(B+1):\n        for k in range(C+1):\n            ans =500*i + 100*j + 50*k\n            if ans == X:\n                cnt += 1\n\nprint(cnt)", "passed": true, "time": 0.25, "memory": 14224.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\ncount=0\n\nfor i in range(A+1):\n  for j in range(B+1):\n    for k in range(C+1):\n      if 500*i + 100*j + 50*k == X:\n        count +=1\n\nprint(count)", "passed": true, "time": 0.15, "memory": 14092.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\ncnt = 0\nsum = 0\nfor i in range(a+1):\n  for j in range(b+1):\n    for k in range(c+1):\n      sum = 500 * i + 100 * j + 50 * k\n      if sum == x:\n        cnt += 1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14192.0, "status": "done"}, {"code": "#-*-coding:utf-8-*-\nimport sys\ninput=sys.stdin.readline\n\ndef main():\n    a = int(input())\n    b = int(input())\n    c = int(input())\n    target = int(input())\n    count=0\n\n    for i in range(a+1):\n        for j in range(b+1):\n            for k in range(c+1):\n                if (500*i)+(100*j)+(50*k)==target:\n                    count+=1\n                else:\n                    continue\n    print(count)\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.23, "memory": 14240.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\ncount = 0\n\nfor i in range(A+1):\n    for j in range(B+1):\n        for k in range(C+1):\n            sum = 500 * int(i) + 100 * int(j) + 50 * int(k)\n            if sum == X:\n                count += 1\n\nprint(count)", "passed": true, "time": 0.26, "memory": 14256.0, "status": "done"}, {"code": "# 34\nA = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\nans = 0\nfor a in range(0, A + 1):\n    if 500 * a > X: continue\n    for b in range(0, B + 1):\n        if 500 * a + 100 * b > X: continue\n        for c in range(0, C + 1):\n            if 500 * a + 100 * b + 50 * c == X: ans +=1\n\nprint(ans)", "passed": true, "time": 0.24, "memory": 14180.0, "status": "done"}, {"code": "[a]=[int(i) for i in input().split()]\n[b]=[int(i) for i in input().split()]\n[c]=[int(i) for i in input().split()]\n[x]=[int(i) for i in input().split()]\nans=0\nfor ia in range(a+1):\n    for ib in range(b+1):\n        for ic in range(c+1):\n            if(ia*500+ib*100+ic*50==x):\n                ans+=1\nprint(ans)\n", "passed": true, "time": 0.17, "memory": 14068.0, "status": "done"}, {"code": "a_coins = int(input())\nb_coins = int(input())\nc_coins = int(input())\nx_num = int(input())\n\ndef money_match(a, b, c):\n    money = 500 * a + 100 * b + 50 * c\n    if money == x_num:\n        return 1\n    else:\n        return 0\n        \ncnt = 0\nfor a in range(a_coins+1):\n    for b in range(b_coins+1):\n        for c in range(c_coins+1):\n            if money_match(a, b, c) == 1:\n                cnt += 1\n                \nprint(cnt)", "passed": true, "time": 0.15, "memory": 14160.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\n\ncnt = 0\n\nfor i in range(a+1):\n    for j in range(b+1):\n        for k in range(c+1):\n            if 500*i + 100*j + 50*k == x:\n                cnt += 1\n\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14352.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\npat = 0\nfor a in range(A+1):\n\tfor b in range(B+1):\n\t\tfor c in range(C+1):\n\t\t\tif a*500+b*100+c*50 == X:\n\t\t\t\tpat += 1\nprint(pat)", "passed": true, "time": 0.16, "memory": 14128.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\ncnt=0\nfor i in range(A+1):\n    for j in range(B+1):\n        for k in range(C+1):\n            if X == 500*i + 100*j + 50*k:\n                cnt+=1\n\nprint(cnt) \n", "passed": true, "time": 0.16, "memory": 14360.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())//50\n\nans = 0\nfor a, b, c in [(a, b, c) for a in range(A+1) for b in range(B+1) for c in range(C+1)]:\n  if 10*a + 2*b + c == X:\n    ans += 1\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 17956.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\nans = 0\n\nfor i in range(0, A+1, 1):\n  for j in range(0, B+1, 1):\n    for k in range(0, C+1, 1):\n      if 500 * i + 100 * j + 50 * k == X:\n        ans += 1\n        \nprint(ans)", "passed": true, "time": 0.85, "memory": 14280.0, "status": "done"}, {"code": "A = input()\nB = input()\nC = input()\nX = input()\n\nA=int(A)\nB=int(B)\nC=int(C)\nX=int(X)\n\ncount=0\nfor a in range(A+1):\n    for b in range(B+1):\n        for c in range(C+1):\n            x=X-(500*a+100*b+50*c)\n            \n            if x==0:\n                count=count+1\n\nprint(count)", "passed": true, "time": 0.57, "memory": 14132.0, "status": "done"}, {"code": "A,B,C,X = list(map(int,[input() for i in range(4)]))\n\nans = 0\n\nfor i in range(A+1):\n    for j in range (B+1):\n        for k in range(C+1):\n            if i *500 + j * 100 + k * 50 == X:\n                ans = ans + 1\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14180.0, "status": "done"}, {"code": "s = [int(input()) for i in range(4)]\nA = s[0]\nB = s[1]\nC = s[2]\nX = s[3]\nres = 0\ntotal = 0\nfor a in range(A+1):\n  for b in range(B+1):\n    for c in range(C+1):\n      total = 500*a + 100*b + 50*c\n#      print(\"A:\"+str(a)+\" B:\"+str(b)+\" C:\"+str(c) + \"total:\"+str(total))\n      if(total == X):res = res +1\nprint(res)", "passed": true, "time": 0.24, "memory": 14164.0, "status": "done"}, {"code": "getints = lambda: map(int, input().split())\na = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\nans = 0\nfor i in range(a+1):\n    for j in range(b+1):\n        for k in range(c+1):\n            val = 500 * i + 100 * j + 50 * k\n            if val == x:\n                ans += 1\nprint(ans)", "passed": true, "time": 0.15, "memory": 14100.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\nans = 0\n\nfor a in range(A+1):\n    for b in range(B+1):\n        for c in range(C+1):\n            if 500*a+100*b+50*c == X:\n                ans += 1\n\nprint(ans)", "passed": true, "time": 0.25, "memory": 14088.0, "status": "done"}, {"code": "def solve(A, B, C, X):\n    ans = 0\n    for a in range(A + 1):\n        for b in range(B + 1):\n            for c in range(C + 1):\n                total = 500 * a + 100 * b + 50 * c\n                if total == X:\n                    ans += 1\n    print(ans)\n\n\ndef __starting_point():\n    A = int(input())\n    B = int(input())\n    C = int(input())\n    X = int(input())\n    solve(A, B, C, X)\n\n__starting_point()", "passed": true, "time": 0.22, "memory": 14192.0, "status": "done"}, {"code": "A=int(input())#500\u5186\u7389\nB=int(input())#100\u5186\u7389\nC=int(input())#50\u5186\u7389\nX=int(input())#\u5408\u8a08\u91d1\u984d\u300250\u306e\u500d\u6570\ncount=0\n\nfor a in range(0,A+1):\n    for b in range(0,B+1):\n        for c in range(0,C+1):\n            if 500*a+100*b+50*c==X:\n                count=count+1\nprint(count)\n", "passed": true, "time": 0.15, "memory": 14132.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\ncnt = 0\nfor i in range(a+1):\n    for j in range(b+1):\n        for k in range(c+1):\n            p = 500*i + 100*j + 50*k\n            if p == x:\n                cnt +=1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14344.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\n\ncount = 0\n\nfor i in range(a+1):\n   for j in range(b+1):\n      for k in range(c+1):\n         if (500 * i) + (100 * j) + (50 * k) == x:\n            count += 1\n\nprint(count)", "passed": true, "time": 0.15, "memory": 14300.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\n\ncnt = 0\nfor i in range(a+1):\n  for j in range(b+1):\n    for k in range(c+1):\n      cand = 500 * i + 100 * j + 50 * k\n      if cand == x:\n        cnt += 1\nprint(cnt)", "passed": true, "time": 0.16, "memory": 14136.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\n\ncnt =0\nfor i in range(a + 1):\n    for j in range(b + 1):\n        for k in range(c + 1):\n            if 500 * i + 100 * j + 50 * k == x:\n                cnt += 1\n                break\n            elif 500 * i + 100 * j + 50 * k > x:\n                break\nprint(cnt)", "passed": true, "time": 0.23, "memory": 14168.0, "status": "done"}, {"code": "n=[int(input()) for i in range(4)]\nprint(sum(0<=(n[3]-500*a-100*b)//50<=n[2] and (n[3]-500*a-100*b)%50==0 for a in range(n[0]+1) for b in range(n[1]+1)))", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\nans = 0\nfor a in range(A+1):\n  for b in range(B+1):\n    for c in range(C+1):\n      if a * 500 + b * 100 + c * 50 == X:\n        ans += 1\nprint(ans)", "passed": true, "time": 0.15, "memory": 14308.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\na = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\n\nans = 0\nfor i in range(a+1):\n    for j in range(b+1):\n        for k in range(c+1):\n            value = 500*i+100*j+50*k\n            if value == x:\n                ans += 1\n\nprint(ans)\n", "passed": true, "time": 0.23, "memory": 14340.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\nans = 0\nfor i in range(a+1):\n    for j in range(b+1):\n        if (x-(500*i + 100*j))%50==0 and ((x-(500*i+100*j))//50)<=c and (500*i+100*j)<=x:\n            ans += 1\n            #print(i, j)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\ncnt = 0\nfor i in range(a+1):\n    for j in range(b+1):\n        for k in range(c+1):\n            total =  i * 500 + j * 100 + k * 50\n            if total == x:\n                cnt += 1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14108.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\nresult = 0\nfor i in range(0, A+1):\n    for j in range(0, B+1):\n        for k in range(0, C+1):\n            coins = 500 * i + 100 * j + 50 * k\n            if coins == X:\n                result += 1\n\nprint(result)", "passed": true, "time": 0.15, "memory": 14200.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\nans = 0\nfor i in range(A+1):\n    for j in range(B+1):\n        for k in range(C+1):\n            if X == (500 * i) + (100 * j) + (50 * k):\n                ans += 1\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14120.0, "status": "done"}, {"code": "A, B, C, X = [int(input()) for i in range(4)]\ncnt = 0\n\nfor a in range(A + 1):\n  for b in range(B + 1):\n    for c in range(C + 1):\n      if 500 * a + 100 * b + 50 * c == X:\n        cnt += 1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14308.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nx = int(input())\nans = 0\nfor a in range(A+1):\n    for b in range(B+1):\n        for c in range(C+1):\n            total = 500*a + 100*b + 50*c\n            if total==x:\n                ans+=1\nprint(ans)", "passed": true, "time": 0.2, "memory": 14224.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\ncnt = 0\nfor i in range(A+1):\n    X_ = X\n    X_ -= 500*i\n    for j in range(B+1):\n        X__ = X_\n        X__ -= 100*j\n        for k in range(C+1):\n            X___ = X__\n            X___ -= 50*k\n            if X___ == 0:\n                cnt += 1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14092.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\n\ncnt = 0\nfor i in range(a+1):\n    for j in range(b+1):\n        for k in range(c+1):\n            if 500*i + 100*j + 50*k == x:\n                cnt += 1\n\nprint(cnt)\n", "passed": true, "time": 0.15, "memory": 14128.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\n\ncount = 0\nfor i in range(a + 1):\n    for j in range(b + 1):\n        for k in range(c + 1):\n            if i * 500 + j * 100 + k * 50 == x:\n                count += 1\nprint(count)", "passed": true, "time": 0.15, "memory": 14252.0, "status": "done"}, {"code": "a, b, c, x = map(int, [input() for i in range(4)])\nans = 0\nfor i in range(a+1):\n    for j in range(b+1):\n        for k in range(c+1):\n            if i * 500 + j * 100 + k * 50 == x:\n                ans += 1\nprint(ans)", "passed": true, "time": 0.15, "memory": 14108.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\nans = 0\n\nfor i in range(a+1):\n    i *= 500\n    for j in range(b+1):\n        j *= 100\n        for k in range(c+1):\n            k *= 50\n            sum = i + k + j\n            if sum == x:\n                ans += 1\n\nprint(ans)\n            \n", "passed": true, "time": 0.15, "memory": 14116.0, "status": "done"}, {"code": "A,B,C,X = [int(input()) for _ in range(4)]\nans = 0\nfor a in range(A+1):\n  for b in range(B+1):\n    for c in range(C+1):\n      if (500*a + 100*b + 50*c) == X:\n        ans += 1\nprint(ans)", "passed": true, "time": 0.15, "memory": 14060.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\n\ncnt = 0\nfor an in range(a+1):\n  for bn in range(b+1):\n    for cn in range(c+1):\n      if x == 500*an + 100*bn + 50*cn:\n        cnt += 1\nprint(cnt)", "passed": true, "time": 0.25, "memory": 14108.0, "status": "done"}, {"code": "A=int(input())\nB=int(input())\nC=int(input())\nX=int(input())\ncount=0\nfor i in range(A+1):\n    for j in range(B+1):\n        for k in range(C+1):\n            if 500*i+100*j+50*k==X: count+=1\nprint(count)", "passed": true, "time": 0.15, "memory": 14156.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\nans=0\nfor i in range(0,a+1):\n  for j in range(0,b+1):\n    for k in range(0,c+1):\n      if 500*i+100*j+50*k==d:\n        ans+=1\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14336.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\nans = 0\nfor i in range(A+1):\n  for j in range(B+1):\n    for k in range(C+1):\n      if(500*i+100*j+50*k)==X:\n        ans += 1\nprint(ans)", "passed": true, "time": 0.25, "memory": 14308.0, "status": "done"}, {"code": "A, B, C, X = [int(input()) for i in range(4)]\nprint(sum(500*a + 100*b + 50*c == X for a in range(A+1) for b in range(B+1) for c in range(C+1)))", "passed": true, "time": 0.15, "memory": 14104.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\ncnt = 0\nfor i in range(a+1):\n    for j in range(b+1):\n        for k in range(c+1):\n            if  i * 500 + j * 100 + k * 50 == x:\n                cnt += 1\nprint(cnt)\n", "passed": true, "time": 0.24, "memory": 14132.0, "status": "done"}, {"code": "A=int(input())\nB=int(input())\nC=int(input())\nX=int(input())\nans=0\nfor i in range(0,A+1):\n    for j in range(0,B+1):\n        for k in range(C+1):\n            if 500*i+100*j+50*k==X:\n                ans+=1\nprint(ans)                \n", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\ncnt = 0\n\nfor i in range(a+1):\n    for j in range(b+1):\n        for k in range(c+1):\n            if i*500+j*100+k*50 == x:\n                cnt += 1\n\nprint(cnt)", "passed": true, "time": 0.22, "memory": 14216.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx1 = int(input())\nx2 = 0\nans = 0\n\nfor i in range(a+1):\n    for j in range(b+1):\n        for k in range(c+1):\n                x2 = 500*i + 100*j + 50*k\n                if (x2==x1):\n                    ans+=1\n\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14256.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\ncount=0\n\nfor a in  range(0,A+1):\n    for b in range(0,B+1):\n        for c in range(0,C+1):\n            total = 500*a + 100*b + 50*c\n            if total == X:\n                count = count+1\n\nprint(count)", "passed": true, "time": 0.15, "memory": 14116.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\nx = 0\nfor a in range(A + 1):\n    for b in range(B + 1):\n        for c in range(C + 1):\n            if 500*a + 100*b + 50*c == X:\n                x += 1\nprint(x)", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "a,b,c,x=[int(input()) for i in range(4)]\nans=0\nfor i in range(a+1):\n  for j in range(b+1):\n    for k in range(c+1):\n      if 500*i+100*j+50*k==x:\n        ans += 1\nprint(ans)", "passed": true, "time": 0.19, "memory": 14212.0, "status": "done"}, {"code": "A = int(input())\nB = int(input())\nC = int(input())\nX = int(input())\n\ntotal = 0\nfor i in range(A+1):\n    for j in range(B+1):\n        for k in range(C+1):\n            Ans = 500*i + 100*j + 50*k\n            if Ans == X:\n                total +=1\nprint(total)\n", "passed": true, "time": 0.15, "memory": 14128.0, "status": "done"}, {"code": "a = int(input())\nb = int(input())\nc = int(input())\nx = int(input())\nans = 0\nfor i in range(a+1):\n  for j in range(b+1):\n    for k in range(c+1):\n      if 500*i + 100*j + 50*k == x:\n        ans += 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "(A, B, C, X) = [int(input()) for i in range(4)]\nways = 0\n\nmax_a = int( X / 500 )\nif A < max_a :\n  max_a = A\nfor a in reversed(list(range( max_a+1))) :\n  max_b = int( (X - 500 * a) / 100 )\n  if B < max_b :\n    max_b = B\n  for b in reversed(list(range( max_b+1))) :\n    c = int ( ( X - 500 * a - 100 * b ) / 50 )\n    if c > C :\n      break\n    ways += 1\nprint(('%d' %ways )) ;\n", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "a=int(input())\nb=int(input())\nc=int(input())\nx=int(input())\n\ncnt=0\nfor i in range(0,a+1):\n    for j in range(0,b+1):\n        for k in range(0,c+1):\n            if 500*i+100*j+50*k==x:\n                cnt+=1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14156.0, "status": "done"}, {"code": "a=int(input())\nb=int(input())\nc=int(input())\nx=int(input())\nans=0\nfor i in range (0,a+1):\n for j in range (0,b+1):\n  for k in range (0,c+1):\n   sum=i*500+j*100+k*50\n   if sum==x:\n     ans=ans+1\nprint(ans)", "passed": true, "time": 0.15, "memory": 14188.0, "status": "done"}, {"code": "A = int(input())  # 500\nB = int(input())  # 100\nC = int(input())  # 50\nX = int(input())  \n\ncount = 0\ntotal_price = 0\nfor i in range(A+1):\n    for j in range(B+1):\n        for k in range(C+1):\n            total_price = 500 * i + 100*j + 50*k\n            if total_price == X:\n                count += 1\nprint(count)", "passed": true, "time": 0.15, "memory": 14084.0, "status": "done"}]