    import java.util.*;
     
    class Main {
       public static void main(String[] args)
       {
          Scanner scan = new Scanner(System.in);
     
          int Y500 = scan.nextInt();
          int Y100 = scan.nextInt();
          int Y50  = scan.nextInt();
     
          int N = scan.nextInt();
          int count = 0;
          int S, U, V;
     
     
          for(int i = Y500; i >= 0; i--){
              S = N;
              S = N - (500 * i);
              if(S == 0){
                 count++;
                 }
              if(S != 0){
                 for(int j = Y100; j >= 0; j--){
                     U = S;
                     U = S - j * 100;
                     if(U == 0){
                        count++;
                        }
                     if(U != 0){
                        for(int k = Y50; k >= 0; k--){
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            }
                        }
                     }
                 }
              }
          System.out.println(count);
       }
    } import java.util.*; util.* java class Main {
       public static void main(String[] args)
       {
          Scanner scan = new Scanner(System.in);
     
          int Y500 = scan.nextInt();
          int Y100 = scan.nextInt();
          int Y50  = scan.nextInt();
     
          int N = scan.nextInt();
          int count = 0;
          int S, U, V;
     
     
          for(int i = Y500; i >= 0; i--){
              S = N;
              S = N - (500 * i);
              if(S == 0){
                 count++;
                 }
              if(S != 0){
                 for(int j = Y100; j >= 0; j--){
                     U = S;
                     U = S - j * 100;
                     if(U == 0){
                        count++;
                        }
                     if(U != 0){
                        for(int k = Y50; k >= 0; k--){
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            }
                        }
                     }
                 }
              }
          System.out.println(count);
       }
    } Main public static void main(String[] args)
       {
          Scanner scan = new Scanner(System.in);
     
          int Y500 = scan.nextInt();
          int Y100 = scan.nextInt();
          int Y50  = scan.nextInt();
     
          int N = scan.nextInt();
          int count = 0;
          int S, U, V;
     
     
          for(int i = Y500; i >= 0; i--){
              S = N;
              S = N - (500 * i);
              if(S == 0){
                 count++;
                 }
              if(S != 0){
                 for(int j = Y100; j >= 0; j--){
                     U = S;
                     U = S - j * 100;
                     if(U == 0){
                        count++;
                        }
                     if(U != 0){
                        for(int k = Y50; k >= 0; k--){
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            }
                        }
                     }
                 }
              }
          System.out.println(count);
       } main {
          Scanner scan = new Scanner(System.in);
     
          int Y500 = scan.nextInt();
          int Y100 = scan.nextInt();
          int Y50  = scan.nextInt();
     
          int N = scan.nextInt();
          int count = 0;
          int S, U, V;
     
     
          for(int i = Y500; i >= 0; i--){
              S = N;
              S = N - (500 * i);
              if(S == 0){
                 count++;
                 }
              if(S != 0){
                 for(int j = Y100; j >= 0; j--){
                     U = S;
                     U = S - j * 100;
                     if(U == 0){
                        count++;
                        }
                     if(U != 0){
                        for(int k = Y50; k >= 0; k--){
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            }
                        }
                     }
                 }
              }
          System.out.println(count);
       } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int Y500 = scan.nextInt(); Y500 scan.nextInt() scan.nextInt scan int Y100 = scan.nextInt(); Y100 scan.nextInt() scan.nextInt scan int Y50  = scan.nextInt(); Y50 scan.nextInt() scan.nextInt scan int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int count = 0; count 0 int S S U U V; V for(int i = Y500; i >= 0; i--){
              S = N;
              S = N - (500 * i);
              if(S == 0){
                 count++;
                 }
              if(S != 0){
                 for(int j = Y100; j >= 0; j--){
                     U = S;
                     U = S - j * 100;
                     if(U == 0){
                        count++;
                        }
                     if(U != 0){
                        for(int k = Y50; k >= 0; k--){
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            }
                        }
                     }
                 }
              } int i = Y500; int i = Y500; i Y500 i >= 0 i 0 i-- i-- i {
              S = N;
              S = N - (500 * i);
              if(S == 0){
                 count++;
                 }
              if(S != 0){
                 for(int j = Y100; j >= 0; j--){
                     U = S;
                     U = S - j * 100;
                     if(U == 0){
                        count++;
                        }
                     if(U != 0){
                        for(int k = Y50; k >= 0; k--){
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            }
                        }
                     }
                 }
              } {
              S = N;
              S = N - (500 * i);
              if(S == 0){
                 count++;
                 }
              if(S != 0){
                 for(int j = Y100; j >= 0; j--){
                     U = S;
                     U = S - j * 100;
                     if(U == 0){
                        count++;
                        }
                     if(U != 0){
                        for(int k = Y50; k >= 0; k--){
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            }
                        }
                     }
                 }
              } S = N S N S = N - (500 * i) S N - (500 * i) N (500 * i) 500 i if(S == 0){
                 count++;
                 } S == 0 S 0 {
                 count++;
                 } count++ count if(S != 0){
                 for(int j = Y100; j >= 0; j--){
                     U = S;
                     U = S - j * 100;
                     if(U == 0){
                        count++;
                        }
                     if(U != 0){
                        for(int k = Y50; k >= 0; k--){
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            }
                        }
                     }
                 } S != 0 S 0 {
                 for(int j = Y100; j >= 0; j--){
                     U = S;
                     U = S - j * 100;
                     if(U == 0){
                        count++;
                        }
                     if(U != 0){
                        for(int k = Y50; k >= 0; k--){
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            }
                        }
                     }
                 } for(int j = Y100; j >= 0; j--){
                     U = S;
                     U = S - j * 100;
                     if(U == 0){
                        count++;
                        }
                     if(U != 0){
                        for(int k = Y50; k >= 0; k--){
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            }
                        }
                     } int j = Y100; int j = Y100; j Y100 j >= 0 j 0 j-- j-- j {
                     U = S;
                     U = S - j * 100;
                     if(U == 0){
                        count++;
                        }
                     if(U != 0){
                        for(int k = Y50; k >= 0; k--){
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            }
                        }
                     } {
                     U = S;
                     U = S - j * 100;
                     if(U == 0){
                        count++;
                        }
                     if(U != 0){
                        for(int k = Y50; k >= 0; k--){
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            }
                        }
                     } U = S U S U = S - j * 100 U S - j * 100 S j * 100 j 100 if(U == 0){
                        count++;
                        } U == 0 U 0 {
                        count++;
                        } count++ count if(U != 0){
                        for(int k = Y50; k >= 0; k--){
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            }
                        } U != 0 U 0 {
                        for(int k = Y50; k >= 0; k--){
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            }
                        } for(int k = Y50; k >= 0; k--){
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            } int k = Y50; int k = Y50; k Y50 k >= 0 k 0 k-- k-- k {
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            } {
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            } V = U V U V = V - (50 * k) V V - (50 * k) V (50 * k) 50 k if(V == 0){
                               count++;
                               } V == 0 V 0 {
                               count++;
                               } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args
    import java.util.*;
     
    class Main {
       public static void main(String[] args)
       {
          Scanner scan = new Scanner(System.in);
     
          int Y500 = scan.nextInt();
          int Y100 = scan.nextInt();
          int Y50  = scan.nextInt();
     
          int N = scan.nextInt();
          int count = 0;
          int S, U, V;
     
     
          for(int i = Y500; i >= 0; i--){
              S = N;
              S = N - (500 * i);
              if(S == 0){
                 count++;
                 }
              if(S != 0){
                 for(int j = Y100; j >= 0; j--){
                     U = S;
                     U = S - j * 100;
                     if(U == 0){
                        count++;
                        }
                     if(U != 0){
                        for(int k = Y50; k >= 0; k--){
                            V = U;
                            V = V - (50 * k);
                            if(V == 0){
                               count++;
                               }
                            }
                        }
                     }
                 }
              }
          System.out.println(count);
       }
    }