#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: nofree nounwind 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) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
  %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)
  %0 = load i32, ptr %a, align 4, !tbaa !5
  %cmp.not33 = icmp slt i32 %0, 0
  br i1 %cmp.not33, label %for.end17, label %for.cond1.preheader.lr.ph

for.cond1.preheader.lr.ph:                        ; preds = %entry
  %1 = load i32, ptr %b, align 4, !tbaa !5
  %cmp2.not29 = icmp slt i32 %1, 0
  %2 = load i32, ptr %c, align 4
  %3 = load i32, ptr %x, align 4
  %cmp5.not26 = icmp slt i32 %2, 0
  %or.cond = select i1 %cmp2.not29, i1 true, i1 %cmp5.not26
  br i1 %or.cond, label %for.end17, label %for.cond1.preheader.preheader

for.cond1.preheader.preheader:                    ; preds = %for.cond1.preheader.lr.ph
  %4 = add i32 %2, 1
  %min.iters.check = icmp ult i32 %4, 8
  %n.vec = and i32 %4, -8
  %broadcast.splatinsert51 = insertelement <4 x i32> poison, i32 %3, i64 0
  %broadcast.splat52 = shufflevector <4 x i32> %broadcast.splatinsert51, <4 x i32> poison, <4 x i32> zeroinitializer
  %cmp.n = icmp eq i32 %4, %n.vec
  br label %for.cond1.preheader

for.cond1.preheader:                              ; preds = %for.cond1.preheader.preheader, %for.cond1.for.inc15_crit_edge.split
  %ans.035 = phi i32 [ %spec.select.lcssa, %for.cond1.for.inc15_crit_edge.split ], [ 0, %for.cond1.preheader.preheader ]
  %i.034 = phi i32 [ %inc16, %for.cond1.for.inc15_crit_edge.split ], [ 0, %for.cond1.preheader.preheader ]
  %mul = mul nsw i32 %i.034, 500
  br label %for.cond4.preheader

for.cond4.preheader:                              ; preds = %for.cond1.preheader, %for.cond4.for.inc12_crit_edge
  %ans.131 = phi i32 [ %ans.035, %for.cond1.preheader ], [ %spec.select.lcssa, %for.cond4.for.inc12_crit_edge ]
  %j.030 = phi i32 [ 0, %for.cond1.preheader ], [ %inc13, %for.cond4.for.inc12_crit_edge ]
  %mul7 = mul nsw i32 %j.030, 100
  %add = add nuw nsw i32 %mul7, %mul
  br i1 %min.iters.check, label %for.body6.preheader, label %vector.ph

vector.ph:                                        ; preds = %for.cond4.preheader
  %5 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %ans.131, i64 0
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %5, %vector.ph ], [ %15, %vector.body ]
  %vec.phi49 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %6 = mul nsw <4 x i32> %vec.ind, <i32 50, i32 50, i32 50, i32 50>
  %7 = mul <4 x i32> %vec.ind, <i32 50, i32 50, i32 50, i32 50>
  %8 = add <4 x i32> %7, <i32 200, i32 200, i32 200, i32 200>
  %9 = add nuw nsw <4 x i32> %broadcast.splat, %6
  %10 = add nuw nsw <4 x i32> %broadcast.splat, %8
  %11 = icmp eq <4 x i32> %9, %broadcast.splat52
  %12 = icmp eq <4 x i32> %10, %broadcast.splat52
  %13 = zext <4 x i1> %11 to <4 x i32>
  %14 = zext <4 x i1> %12 to <4 x i32>
  %15 = add <4 x i32> %vec.phi, %13
  %16 = add <4 x i32> %vec.phi49, %14
  %index.next = add nuw i32 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %17 = icmp eq i32 %index.next, %n.vec
  br i1 %17, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %16, %15
  %18 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  br i1 %cmp.n, label %for.cond4.for.inc12_crit_edge, label %for.body6.preheader

for.body6.preheader:                              ; preds = %for.cond4.preheader, %middle.block
  %ans.228.ph = phi i32 [ %ans.131, %for.cond4.preheader ], [ %18, %middle.block ]
  %k.027.ph = phi i32 [ 0, %for.cond4.preheader ], [ %n.vec, %middle.block ]
  br label %for.body6

for.body6:                                        ; preds = %for.body6.preheader, %for.body6
  %ans.228 = phi i32 [ %spec.select, %for.body6 ], [ %ans.228.ph, %for.body6.preheader ]
  %k.027 = phi i32 [ %inc11, %for.body6 ], [ %k.027.ph, %for.body6.preheader ]
  %mul8 = mul nsw i32 %k.027, 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.228, %inc
  %inc11 = add nuw i32 %k.027, 1
  %exitcond.not = icmp eq i32 %k.027, %2
  br i1 %exitcond.not, label %for.cond4.for.inc12_crit_edge, label %for.body6, !llvm.loop !12

for.cond4.for.inc12_crit_edge:                    ; preds = %for.body6, %middle.block
  %spec.select.lcssa = phi i32 [ %18, %middle.block ], [ %spec.select, %for.body6 ]
  %inc13 = add nuw i32 %j.030, 1
  %exitcond47.not = icmp eq i32 %j.030, %1
  br i1 %exitcond47.not, label %for.cond1.for.inc15_crit_edge.split, label %for.cond4.preheader

for.cond1.for.inc15_crit_edge.split:              ; preds = %for.cond4.for.inc12_crit_edge
  %inc16 = add nuw i32 %i.034, 1
  %exitcond48.not = icmp eq i32 %i.034, %0
  br i1 %exitcond48.not, label %for.end17, label %for.cond1.preheader

for.end17:                                        ; preds = %for.cond1.for.inc15_crit_edge.split, %for.cond1.preheader.lr.ph, %entry
  %ans.0.lcssa = phi i32 [ 0, %entry ], [ 0, %for.cond1.preheader.lr.ph ], [ %spec.select.lcssa, %for.cond1.for.inc15_crit_edge.split ]
  %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
  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: nofree nounwind
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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3

attributes #0 = { nofree nounwind 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 = { nofree nounwind "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }

!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"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !11, !10}
