import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] coins = {500, 100, 50};
        int[] coin = new int[3];

        coin[0]=scanner.nextInt();
        coin[1]=scanner.nextInt();
        coin[2]=scanner.nextInt();
        int sum = scanner.nextInt();

        int count=0;
        for(int i=0;i<=coin[0];i++){
            for(int j=0;j<=coin[1];j++){
                for(int k=0;k<=coin[2];k++){
                    if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    }
                }
            }
        }

        System.out.println(count);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] coins = {500, 100, 50};
        int[] coin = new int[3];

        coin[0]=scanner.nextInt();
        coin[1]=scanner.nextInt();
        coin[2]=scanner.nextInt();
        int sum = scanner.nextInt();

        int count=0;
        for(int i=0;i<=coin[0];i++){
            for(int j=0;j<=coin[1];j++){
                for(int k=0;k<=coin[2];k++){
                    if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    }
                }
            }
        }

        System.out.println(count);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] coins = {500, 100, 50};
        int[] coin = new int[3];

        coin[0]=scanner.nextInt();
        coin[1]=scanner.nextInt();
        coin[2]=scanner.nextInt();
        int sum = scanner.nextInt();

        int count=0;
        for(int i=0;i<=coin[0];i++){
            for(int j=0;j<=coin[1];j++){
                for(int k=0;k<=coin[2];k++){
                    if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    }
                }
            }
        }

        System.out.println(count);
    } main {
        Scanner scanner = new Scanner(System.in);
        int[] coins = {500, 100, 50};
        int[] coin = new int[3];

        coin[0]=scanner.nextInt();
        coin[1]=scanner.nextInt();
        coin[2]=scanner.nextInt();
        int sum = scanner.nextInt();

        int count=0;
        for(int i=0;i<=coin[0];i++){
            for(int j=0;j<=coin[1];j++){
                for(int k=0;k<=coin[2];k++){
                    if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    }
                }
            }
        }

        System.out.println(count);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int[] coins = {500, 100, 50}; coins {500, 100, 50} 500 100 50 int[] coin = new int[3]; coin new int[3] 3 coin[0]=scanner.nextInt() coin[0] coin 0 scanner.nextInt() scanner.nextInt scanner coin[1]=scanner.nextInt() coin[1] coin 1 scanner.nextInt() scanner.nextInt scanner coin[2]=scanner.nextInt() coin[2] coin 2 scanner.nextInt() scanner.nextInt scanner int sum = scanner.nextInt(); sum scanner.nextInt() scanner.nextInt scanner int count=0; count 0 for(int i=0;i<=coin[0];i++){
            for(int j=0;j<=coin[1];j++){
                for(int k=0;k<=coin[2];k++){
                    if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    }
                }
            }
        } int i=0; int i=0; i 0 i<=coin[0] i coin[0] coin 0 i++ i++ i {
            for(int j=0;j<=coin[1];j++){
                for(int k=0;k<=coin[2];k++){
                    if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    }
                }
            }
        } {
            for(int j=0;j<=coin[1];j++){
                for(int k=0;k<=coin[2];k++){
                    if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    }
                }
            }
        } for(int j=0;j<=coin[1];j++){
                for(int k=0;k<=coin[2];k++){
                    if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    }
                }
            } int j=0; int j=0; j 0 j<=coin[1] j coin[1] coin 1 j++ j++ j {
                for(int k=0;k<=coin[2];k++){
                    if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    }
                }
            } {
                for(int k=0;k<=coin[2];k++){
                    if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    }
                }
            } for(int k=0;k<=coin[2];k++){
                    if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    }
                } int k=0; int k=0; k 0 k<=coin[2] k coin[2] coin 2 k++ k++ k {
                    if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    }
                } {
                    if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    }
                } if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    } (coins[0]*i + coins[1]*j + coins[2]*k)==sum (coins[0]*i + coins[1]*j + coins[2]*k) coins[0]*i + coins[1]*j + coins[2]*k coins[0]*i coins[0] coins 0 i coins[1]*j coins[1] coins 1 j coins[2]*k coins[2] coins 2 k sum {
                        count++;
                    } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] coins = {500, 100, 50};
        int[] coin = new int[3];

        coin[0]=scanner.nextInt();
        coin[1]=scanner.nextInt();
        coin[2]=scanner.nextInt();
        int sum = scanner.nextInt();

        int count=0;
        for(int i=0;i<=coin[0];i++){
            for(int j=0;j<=coin[1];j++){
                for(int k=0;k<=coin[2];k++){
                    if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    }
                }
            }
        }

        System.out.println(count);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] coins = {500, 100, 50};
        int[] coin = new int[3];

        coin[0]=scanner.nextInt();
        coin[1]=scanner.nextInt();
        coin[2]=scanner.nextInt();
        int sum = scanner.nextInt();

        int count=0;
        for(int i=0;i<=coin[0];i++){
            for(int j=0;j<=coin[1];j++){
                for(int k=0;k<=coin[2];k++){
                    if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    }
                }
            }
        }

        System.out.println(count);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] coins = {500, 100, 50};
        int[] coin = new int[3];

        coin[0]=scanner.nextInt();
        coin[1]=scanner.nextInt();
        coin[2]=scanner.nextInt();
        int sum = scanner.nextInt();

        int count=0;
        for(int i=0;i<=coin[0];i++){
            for(int j=0;j<=coin[1];j++){
                for(int k=0;k<=coin[2];k++){
                    if((coins[0]*i + coins[1]*j + coins[2]*k)==sum){
                        count++;
                    }
                }
            }
        }

        System.out.println(count);
    }
}