INTEGER A,B,C,X,ANS
READ*,A,B,C,X
ANS=0
DO I=0,A
  DO J=0,B
    DO K=0,C
      IF(I*500+J*100+K*50==X)ANS=ANS+1
      IF(I*500+J*100+K*50>X)EXIT
    END DO
    IF(I*500+J*100>X)EXIT
  END DO
  IF(I*500>X)EXIT
END DO
PRINT"(I0)",ANS
END