#include<stdio.h>
int main(void) {
  int a, b, c, x;
  int ans = 0;
  scanf("%d%d%d%d", &a, &b, &c, &x);
  int i, j, k;
  for (i = 0; i <= a; i++) {
    for (j = 0; j <= b; j++) {
      for (k = 0; k <= c; k++) {
        int t = 500 * i + 100 * j + 50 * k;
        if (t == x)
          ans++;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_605/source.m'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_605/source.m"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1

; Function Attrs: minsize nofree nounwind optsize uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
  %a = alloca i32, align 4
  %b = alloca i32, align 4
  %c = alloca i32, align 4
  %x = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
  %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %x) #4
  %0 = load i32, ptr %a, align 4, !tbaa !5
  %1 = load i32, ptr %b, align 4
  %2 = load i32, ptr %c, align 4
  %3 = load i32, ptr %x, align 4
  br label %for.cond

for.cond:                                         ; preds = %for.inc15, %entry
  %i.0 = phi i32 [ 0, %entry ], [ %inc16, %for.inc15 ]
  %ans.0 = phi i32 [ 0, %entry ], [ %ans.1, %for.inc15 ]
  %cmp.not = icmp sgt i32 %i.0, %0
  br i1 %cmp.not, label %for.end17, label %for.cond1.preheader

for.cond1.preheader:                              ; preds = %for.cond
  %mul = mul nsw i32 %i.0, 500
  br label %for.cond1

for.cond1:                                        ; preds = %for.cond1.preheader, %for.inc12
  %j.0 = phi i32 [ %inc13, %for.inc12 ], [ 0, %for.cond1.preheader ]
  %ans.1 = phi i32 [ %ans.2, %for.inc12 ], [ %ans.0, %for.cond1.preheader ]
  %cmp2.not = icmp sgt i32 %j.0, %1
  br i1 %cmp2.not, label %for.inc15, label %for.cond4.preheader

for.cond4.preheader:                              ; preds = %for.cond1
  %mul7 = mul nsw i32 %j.0, 100
  %add = add nuw nsw i32 %mul7, %mul
  br label %for.cond4

for.cond4:                                        ; preds = %for.cond4.preheader, %for.body6
  %k.0 = phi i32 [ %inc11, %for.body6 ], [ 0, %for.cond4.preheader ]
  %ans.2 = phi i32 [ %spec.select, %for.body6 ], [ %ans.1, %for.cond4.preheader ]
  %cmp5.not = icmp sgt i32 %k.0, %2
  br i1 %cmp5.not, label %for.inc12, label %for.body6

for.body6:                                        ; preds = %for.cond4
  %mul8 = mul nsw i32 %k.0, 50
  %add9 = add nuw nsw i32 %add, %mul8
  %cmp10 = icmp eq i32 %add9, %3
  %inc = zext i1 %cmp10 to i32
  %spec.select = add nsw i32 %ans.2, %inc
  %inc11 = add nuw nsw i32 %k.0, 1
  br label %for.cond4

for.inc12:                                        ; preds = %for.cond4
  %inc13 = add nuw nsw i32 %j.0, 1
  br label %for.cond1

for.inc15:                                        ; preds = %for.cond1
  %inc16 = add nuw nsw i32 %i.0, 1
  br label %for.cond

for.end17:                                        ; preds = %for.cond
  %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
  ret i32 0
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: minsize nofree nounwind optsize
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: minsize nofree nounwind optsize
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

attributes #0 = { minsize nofree nounwind optsize uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { minsize nofree nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
attributes #4 = { minsize optsize }

!llvm.linker.options = !{}
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
