//usr/bin/env picoc $0 - $@;exit
#include <stdio.h>
int main(){
	int a,b,c,x,i,j,k,r=0;
	scanf("%d%d%d%d",&a,&b,&c,&x);
	for(i=0;i<=x/500;i++)for(j=0;j<=(x-500*i)/100;j++){
		k=x-500*i-100*j;
		r+=k%50==0&&c>=k/50&&a>=i&&b>=j;
	}
	printf("%d\n",r);
	return 0;
}

; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_604/source.m'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_604/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 %x, align 4, !tbaa !5
  %cmp.not31 = icmp slt i32 %0, -499
  br i1 %cmp.not31, label %for.end17, label %for.cond1.preheader.lr.ph

for.cond1.preheader.lr.ph:                        ; preds = %entry
  %div = sdiv i32 %0, 500
  %1 = load i32, ptr %c, align 4
  %2 = load i32, ptr %a, align 4
  %3 = load i32, ptr %b, align 4
  %broadcast.splatinsert39 = insertelement <4 x i32> poison, i32 %1, i64 0
  %broadcast.splat40 = shufflevector <4 x i32> %broadcast.splatinsert39, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert41 = insertelement <4 x i32> poison, i32 %3, i64 0
  %broadcast.splat42 = shufflevector <4 x i32> %broadcast.splatinsert41, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %for.cond1.preheader

for.cond1.preheader:                              ; preds = %for.cond1.preheader.lr.ph, %for.inc15
  %r.033 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %r.1.lcssa, %for.inc15 ]
  %i.032 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %inc16, %for.inc15 ]
  %mul.neg = mul i32 %i.032, -500
  %sub = add i32 %0, %mul.neg
  %div2 = sdiv i32 %sub, 100
  %cmp3.not28 = icmp slt i32 %sub, -99
  br i1 %cmp3.not28, label %for.inc15, label %for.body4.lr.ph

for.body4.lr.ph:                                  ; preds = %for.cond1.preheader
  %cmp13.not = icmp slt i32 %2, %i.032
  %cmp13.not.fr = freeze i1 %cmp13.not
  br i1 %cmp13.not.fr, label %for.inc15, label %for.body4.preheader

for.body4.preheader:                              ; preds = %for.body4.lr.ph
  %4 = add nsw i32 %div2, 1
  %min.iters.check = icmp ult i32 %4, 8
  br i1 %min.iters.check, label %for.body4.preheader43, label %vector.ph

vector.ph:                                        ; preds = %for.body4.preheader
  %n.vec = and i32 %4, -8
  %5 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %r.033, i64 0
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %sub, 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 ], [ %26, %vector.body ]
  %vec.phi37 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %27, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %6 = mul <4 x i32> %vec.ind, <i32 -100, i32 -100, i32 -100, i32 -100>
  %7 = mul <4 x i32> %step.add, <i32 -100, i32 -100, i32 -100, i32 -100>
  %8 = add <4 x i32> %6, %broadcast.splat
  %9 = add <4 x i32> %7, %broadcast.splat
  %.frozen = freeze <4 x i32> %8
  %10 = sdiv <4 x i32> %.frozen, <i32 50, i32 50, i32 50, i32 50>
  %11 = mul <4 x i32> %10, <i32 50, i32 50, i32 50, i32 50>
  %.decomposed = sub <4 x i32> %.frozen, %11
  %.frozen46 = freeze <4 x i32> %9
  %12 = sdiv <4 x i32> %.frozen46, <i32 50, i32 50, i32 50, i32 50>
  %13 = mul <4 x i32> %12, <i32 50, i32 50, i32 50, i32 50>
  %.decomposed47 = sub <4 x i32> %.frozen46, %13
  %14 = icmp eq <4 x i32> %.decomposed, zeroinitializer
  %15 = icmp eq <4 x i32> %.decomposed47, zeroinitializer
  %16 = icmp sge <4 x i32> %broadcast.splat40, %10
  %17 = icmp sge <4 x i32> %broadcast.splat40, %12
  %18 = select <4 x i1> %14, <4 x i1> %16, <4 x i1> zeroinitializer
  %19 = select <4 x i1> %15, <4 x i1> %17, <4 x i1> zeroinitializer
  %20 = icmp sge <4 x i32> %broadcast.splat42, %vec.ind
  %21 = icmp sge <4 x i32> %broadcast.splat42, %step.add
  %22 = select <4 x i1> %18, <4 x i1> %20, <4 x i1> zeroinitializer
  %23 = select <4 x i1> %19, <4 x i1> %21, <4 x i1> zeroinitializer
  %24 = zext <4 x i1> %22 to <4 x i32>
  %25 = zext <4 x i1> %23 to <4 x i32>
  %26 = add <4 x i32> %vec.phi, %24
  %27 = add <4 x i32> %vec.phi37, %25
  %index.next = add nuw i32 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %28 = icmp eq i32 %index.next, %n.vec
  br i1 %28, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %27, %26
  %29 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i32 %4, %n.vec
  br i1 %cmp.n, label %for.inc15, label %for.body4.preheader43

for.body4.preheader43:                            ; preds = %for.body4.preheader, %middle.block
  %r.130.ph = phi i32 [ %r.033, %for.body4.preheader ], [ %29, %middle.block ]
  %j.029.ph = phi i32 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ]
  br label %for.body4

for.body4:                                        ; preds = %for.body4.preheader43, %for.body4
  %r.130 = phi i32 [ %add, %for.body4 ], [ %r.130.ph, %for.body4.preheader43 ]
  %j.029 = phi i32 [ %inc, %for.body4 ], [ %j.029.ph, %for.body4.preheader43 ]
  %mul7.neg = mul i32 %j.029, -100
  %sub8 = add i32 %mul7.neg, %sub
  %rem = srem i32 %sub8, 50
  %cmp9 = icmp eq i32 %rem, 0
  %div10 = sdiv i32 %sub8, 50
  %cmp11.not = icmp sge i32 %1, %div10
  %or.cond.not = select i1 %cmp9, i1 %cmp11.not, i1 false
  %cmp14 = icmp sge i32 %3, %j.029
  %spec.select = select i1 %or.cond.not, i1 %cmp14, i1 false
  %land.ext = zext i1 %spec.select to i32
  %add = add nsw i32 %r.130, %land.ext
  %inc = add nuw nsw i32 %j.029, 1
  %exitcond.not = icmp eq i32 %j.029, %div2
  br i1 %exitcond.not, label %for.inc15, label %for.body4, !llvm.loop !12

for.inc15:                                        ; preds = %for.body4, %middle.block, %for.body4.lr.ph, %for.cond1.preheader
  %r.1.lcssa = phi i32 [ %r.033, %for.cond1.preheader ], [ %r.033, %for.body4.lr.ph ], [ %29, %middle.block ], [ %add, %for.body4 ]
  %inc16 = add nuw nsw i32 %i.032, 1
  %exitcond36.not = icmp eq i32 %i.032, %div
  br i1 %exitcond36.not, label %for.end17, label %for.cond1.preheader

for.end17:                                        ; preds = %for.inc15, %entry
  %r.0.lcssa = phi i32 [ 0, %entry ], [ %r.1.lcssa, %for.inc15 ]
  %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %r.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: nofree nounwind
declare noundef i32 @printf(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: 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}
