#!/bin/python3 import sys def permute(LIST): length=len(LIST) if length <= 1: yield LIST else: for n in range(0,length): for end in permute( LIST[:n] + LIST[n+1:] ): yield [ LIST[n] ] + end def howManyGames(p, d, m, s): sum1 = 0 count = 0 count1 = 0 row = [d,m] for x in permute(row): count1+=1 for i in x: sum1 += 20 - i if sum1 < s: count+=3 return count if __name__ == "__main__": p, d, m, s = input().strip().split(' ') p, d, m, s = [int(p), int(d), int(m), int(s)] answer = howManyGames(p, d, m, s) print(answer)