realize50::Int->Int->Int
realize50 lim50 n = if mod n 50 == 0 && div n 50 <= lim50 then 1 else 0

realize100::Int->Int->Int->Int
realize100 lim50 lim100 n = sum [realize50 lim50 (n-(100*i))|i<-[0..min lim100 (div n 100)]]

realize500::Int->Int->Int->Int->Int
realize500 lim50 lim100 lim500 n = sum [realize100 lim50 lim100 (n-(500*i))|i<-[0..min lim500 (div n 500)]]


main::IO()
main=do
  ac<-getLine
  bc<-getLine
  cc<-getLine
  xc<-getLine
  let a:b:c:x:[]=map read [ac,bc,cc,xc]::[Int]
  print (realize500 c b a x)