import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int fiveHundred = Integer.parseInt(scanner.nextLine());
        int hundred = Integer.parseInt(scanner.nextLine());
        int fifty = Integer.parseInt(scanner.nextLine());
        int money = Integer.parseInt(scanner.nextLine());

        if (money % 100 == 50) {
            if (fifty == 0) {
                System.out.println(0);
                System.exit(0);
            }
            fifty -= 1;
            money -= 50;
        }

        int total = 0;
        for (int i = Math.min(fiveHundred, Math.floorDiv(money, 500)); i >= 0; i--) {
            total += countUp(money - (500 * i), hundred, fifty);
        }
        System.out.println(total);
    }

    public static int countUp(int sum, int hundred, int fifty) {
        int c = 0;
        for (int i = Math.min(hundred, sum / 100); i >= 0; i--) {
            if ((sum - (i * 100)) <= (fifty * 50)) {
                c++;
            }
        }
        return c;
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int fiveHundred = Integer.parseInt(scanner.nextLine());
        int hundred = Integer.parseInt(scanner.nextLine());
        int fifty = Integer.parseInt(scanner.nextLine());
        int money = Integer.parseInt(scanner.nextLine());

        if (money % 100 == 50) {
            if (fifty == 0) {
                System.out.println(0);
                System.exit(0);
            }
            fifty -= 1;
            money -= 50;
        }

        int total = 0;
        for (int i = Math.min(fiveHundred, Math.floorDiv(money, 500)); i >= 0; i--) {
            total += countUp(money - (500 * i), hundred, fifty);
        }
        System.out.println(total);
    }

    public static int countUp(int sum, int hundred, int fifty) {
        int c = 0;
        for (int i = Math.min(hundred, sum / 100); i >= 0; i--) {
            if ((sum - (i * 100)) <= (fifty * 50)) {
                c++;
            }
        }
        return c;
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int fiveHundred = Integer.parseInt(scanner.nextLine());
        int hundred = Integer.parseInt(scanner.nextLine());
        int fifty = Integer.parseInt(scanner.nextLine());
        int money = Integer.parseInt(scanner.nextLine());

        if (money % 100 == 50) {
            if (fifty == 0) {
                System.out.println(0);
                System.exit(0);
            }
            fifty -= 1;
            money -= 50;
        }

        int total = 0;
        for (int i = Math.min(fiveHundred, Math.floorDiv(money, 500)); i >= 0; i--) {
            total += countUp(money - (500 * i), hundred, fifty);
        }
        System.out.println(total);
    } main {
        Scanner scanner = new Scanner(System.in);
        int fiveHundred = Integer.parseInt(scanner.nextLine());
        int hundred = Integer.parseInt(scanner.nextLine());
        int fifty = Integer.parseInt(scanner.nextLine());
        int money = Integer.parseInt(scanner.nextLine());

        if (money % 100 == 50) {
            if (fifty == 0) {
                System.out.println(0);
                System.exit(0);
            }
            fifty -= 1;
            money -= 50;
        }

        int total = 0;
        for (int i = Math.min(fiveHundred, Math.floorDiv(money, 500)); i >= 0; i--) {
            total += countUp(money - (500 * i), hundred, fifty);
        }
        System.out.println(total);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int fiveHundred = Integer.parseInt(scanner.nextLine()); fiveHundred Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner int hundred = Integer.parseInt(scanner.nextLine()); hundred Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner int fifty = Integer.parseInt(scanner.nextLine()); fifty Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner int money = Integer.parseInt(scanner.nextLine()); money Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner if (money % 100 == 50) {
            if (fifty == 0) {
                System.out.println(0);
                System.exit(0);
            }
            fifty -= 1;
            money -= 50;
        } money % 100 == 50 money % 100 money 100 50 {
            if (fifty == 0) {
                System.out.println(0);
                System.exit(0);
            }
            fifty -= 1;
            money -= 50;
        } if (fifty == 0) {
                System.out.println(0);
                System.exit(0);
            } fifty == 0 fifty 0 {
                System.out.println(0);
                System.exit(0);
            } System.out.println(0) System.out.println System.out System System.out 0 System.exit(0) System.exit System 0 fifty -= 1 fifty 1 money -= 50 money 50 int total = 0; total 0 for (int i = Math.min(fiveHundred, Math.floorDiv(money, 500)); i >= 0; i--) {
            total += countUp(money - (500 * i), hundred, fifty);
        } int i = Math.min(fiveHundred, Math.floorDiv(money, 500)); int i = Math.min(fiveHundred, Math.floorDiv(money, 500)); i Math.min(fiveHundred, Math.floorDiv(money, 500)) Math.min Math fiveHundred Math.floorDiv(money, 500) Math.floorDiv Math money 500 i >= 0 i 0 i-- i-- i {
            total += countUp(money - (500 * i), hundred, fifty);
        } {
            total += countUp(money - (500 * i), hundred, fifty);
        } total += countUp(money - (500 * i), hundred, fifty) total countUp(money - (500 * i), hundred, fifty) countUp money - (500 * i) money (500 * i) 500 i hundred fifty System.out.println(total) System.out.println System.out System System.out total String[] args args public static int countUp(int sum, int hundred, int fifty) {
        int c = 0;
        for (int i = Math.min(hundred, sum / 100); i >= 0; i--) {
            if ((sum - (i * 100)) <= (fifty * 50)) {
                c++;
            }
        }
        return c;
    } countUp {
        int c = 0;
        for (int i = Math.min(hundred, sum / 100); i >= 0; i--) {
            if ((sum - (i * 100)) <= (fifty * 50)) {
                c++;
            }
        }
        return c;
    } int c = 0; c 0 for (int i = Math.min(hundred, sum / 100); i >= 0; i--) {
            if ((sum - (i * 100)) <= (fifty * 50)) {
                c++;
            }
        } int i = Math.min(hundred, sum / 100); int i = Math.min(hundred, sum / 100); i Math.min(hundred, sum / 100) Math.min Math hundred sum / 100 sum 100 i >= 0 i 0 i-- i-- i {
            if ((sum - (i * 100)) <= (fifty * 50)) {
                c++;
            }
        } {
            if ((sum - (i * 100)) <= (fifty * 50)) {
                c++;
            }
        } if ((sum - (i * 100)) <= (fifty * 50)) {
                c++;
            } (sum - (i * 100)) <= (fifty * 50) (sum - (i * 100)) sum (i * 100) i 100 (fifty * 50) fifty 50 {
                c++;
            } c++ c return c; c int sum sum int hundred hundred int fifty fifty public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int fiveHundred = Integer.parseInt(scanner.nextLine());
        int hundred = Integer.parseInt(scanner.nextLine());
        int fifty = Integer.parseInt(scanner.nextLine());
        int money = Integer.parseInt(scanner.nextLine());

        if (money % 100 == 50) {
            if (fifty == 0) {
                System.out.println(0);
                System.exit(0);
            }
            fifty -= 1;
            money -= 50;
        }

        int total = 0;
        for (int i = Math.min(fiveHundred, Math.floorDiv(money, 500)); i >= 0; i--) {
            total += countUp(money - (500 * i), hundred, fifty);
        }
        System.out.println(total);
    }

    public static int countUp(int sum, int hundred, int fifty) {
        int c = 0;
        for (int i = Math.min(hundred, sum / 100); i >= 0; i--) {
            if ((sum - (i * 100)) <= (fifty * 50)) {
                c++;
            }
        }
        return c;
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int fiveHundred = Integer.parseInt(scanner.nextLine());
        int hundred = Integer.parseInt(scanner.nextLine());
        int fifty = Integer.parseInt(scanner.nextLine());
        int money = Integer.parseInt(scanner.nextLine());

        if (money % 100 == 50) {
            if (fifty == 0) {
                System.out.println(0);
                System.exit(0);
            }
            fifty -= 1;
            money -= 50;
        }

        int total = 0;
        for (int i = Math.min(fiveHundred, Math.floorDiv(money, 500)); i >= 0; i--) {
            total += countUp(money - (500 * i), hundred, fifty);
        }
        System.out.println(total);
    }

    public static int countUp(int sum, int hundred, int fifty) {
        int c = 0;
        for (int i = Math.min(hundred, sum / 100); i >= 0; i--) {
            if ((sum - (i * 100)) <= (fifty * 50)) {
                c++;
            }
        }
        return c;
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int fiveHundred = Integer.parseInt(scanner.nextLine());
        int hundred = Integer.parseInt(scanner.nextLine());
        int fifty = Integer.parseInt(scanner.nextLine());
        int money = Integer.parseInt(scanner.nextLine());

        if (money % 100 == 50) {
            if (fifty == 0) {
                System.out.println(0);
                System.exit(0);
            }
            fifty -= 1;
            money -= 50;
        }

        int total = 0;
        for (int i = Math.min(fiveHundred, Math.floorDiv(money, 500)); i >= 0; i--) {
            total += countUp(money - (500 * i), hundred, fifty);
        }
        System.out.println(total);
    }

    public static int countUp(int sum, int hundred, int fifty) {
        int c = 0;
        for (int i = Math.min(hundred, sum / 100); i >= 0; i--) {
            if ((sum - (i * 100)) <= (fifty * 50)) {
                c++;
            }
        }
        return c;
    }
}