import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    static String INPUT = "";

    public static void main(String[] args) {
        InputStream is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());

        Scanner scanner = new Scanner(is);

        final int fiveHundred = scanner.nextInt();
        final int hundred = scanner.nextInt();
        final int fifty = scanner.nextInt();
        final int x = scanner.nextInt();
        List<Pair> keys = new ArrayList<>();
        keys.add(new Pair(500, fiveHundred));
        keys.add(new Pair(100, hundred));
        keys.add(new Pair(50, fifty));
        final List<List<Pair>> result = solve(keys, 0, x, new ArrayList<>());
        System.out.println(result.size());
    }

    static class Pair {
        int val;
        int count;

        public Pair(int val, int count) {
            this.val = val;
            this.count = count;
        }
    }

    static List<List<Pair>> solve(List<Pair> keys, int position, int remaining, List<Pair> acc) {
        List<List<Pair>> result = new ArrayList<>();
        if (position == keys.size()) {

            if (remaining == 0) {
                result.add(new ArrayList<>(acc));
            }
            return result;
        }

        final Pair currentPair = keys.get(position);

        for (int i = 0; i <= remaining / currentPair.val && i <= currentPair.count; i++) {
            acc.add(new Pair(currentPair.val, i));
            result.addAll(solve(keys, position + 1, remaining - currentPair.val * i, acc));
            acc.remove(acc.size() - 1);
        }
        return result;
    }

} import java.io.ByteArrayInputStream; ByteArrayInputStream java.io import java.io.InputStream; InputStream java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
    static String INPUT = "";

    public static void main(String[] args) {
        InputStream is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());

        Scanner scanner = new Scanner(is);

        final int fiveHundred = scanner.nextInt();
        final int hundred = scanner.nextInt();
        final int fifty = scanner.nextInt();
        final int x = scanner.nextInt();
        List<Pair> keys = new ArrayList<>();
        keys.add(new Pair(500, fiveHundred));
        keys.add(new Pair(100, hundred));
        keys.add(new Pair(50, fifty));
        final List<List<Pair>> result = solve(keys, 0, x, new ArrayList<>());
        System.out.println(result.size());
    }

    static class Pair {
        int val;
        int count;

        public Pair(int val, int count) {
            this.val = val;
            this.count = count;
        }
    }

    static List<List<Pair>> solve(List<Pair> keys, int position, int remaining, List<Pair> acc) {
        List<List<Pair>> result = new ArrayList<>();
        if (position == keys.size()) {

            if (remaining == 0) {
                result.add(new ArrayList<>(acc));
            }
            return result;
        }

        final Pair currentPair = keys.get(position);

        for (int i = 0; i <= remaining / currentPair.val && i <= currentPair.count; i++) {
            acc.add(new Pair(currentPair.val, i));
            result.addAll(solve(keys, position + 1, remaining - currentPair.val * i, acc));
            acc.remove(acc.size() - 1);
        }
        return result;
    }

} Main static String INPUT = ""; INPUT "" public static void main(String[] args) {
        InputStream is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());

        Scanner scanner = new Scanner(is);

        final int fiveHundred = scanner.nextInt();
        final int hundred = scanner.nextInt();
        final int fifty = scanner.nextInt();
        final int x = scanner.nextInt();
        List<Pair> keys = new ArrayList<>();
        keys.add(new Pair(500, fiveHundred));
        keys.add(new Pair(100, hundred));
        keys.add(new Pair(50, fifty));
        final List<List<Pair>> result = solve(keys, 0, x, new ArrayList<>());
        System.out.println(result.size());
    } main {
        InputStream is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());

        Scanner scanner = new Scanner(is);

        final int fiveHundred = scanner.nextInt();
        final int hundred = scanner.nextInt();
        final int fifty = scanner.nextInt();
        final int x = scanner.nextInt();
        List<Pair> keys = new ArrayList<>();
        keys.add(new Pair(500, fiveHundred));
        keys.add(new Pair(100, hundred));
        keys.add(new Pair(50, fifty));
        final List<List<Pair>> result = solve(keys, 0, x, new ArrayList<>());
        System.out.println(result.size());
    } InputStream is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes()); is INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes()) INPUT.isEmpty() INPUT.isEmpty INPUT System.in System System.in new ByteArrayInputStream(INPUT.getBytes()) Scanner scanner = new Scanner(is); scanner new Scanner(is) final int fiveHundred = scanner.nextInt(); fiveHundred scanner.nextInt() scanner.nextInt scanner final int hundred = scanner.nextInt(); hundred scanner.nextInt() scanner.nextInt scanner final int fifty = scanner.nextInt(); fifty scanner.nextInt() scanner.nextInt scanner final int x = scanner.nextInt(); x scanner.nextInt() scanner.nextInt scanner List<Pair> keys = new ArrayList<>(); keys new ArrayList<>() keys.add(new Pair(500, fiveHundred)) keys.add keys new Pair(500, fiveHundred) keys.add(new Pair(100, hundred)) keys.add keys new Pair(100, hundred) keys.add(new Pair(50, fifty)) keys.add keys new Pair(50, fifty) final List<List<Pair>> result = solve(keys, 0, x, new ArrayList<>()); result solve(keys, 0, x, new ArrayList<>()) solve keys 0 x new ArrayList<>() System.out.println(result.size()) System.out.println System.out System System.out result.size() result.size result String[] args args static List<List<Pair>> solve(List<Pair> keys, int position, int remaining, List<Pair> acc) {
        List<List<Pair>> result = new ArrayList<>();
        if (position == keys.size()) {

            if (remaining == 0) {
                result.add(new ArrayList<>(acc));
            }
            return result;
        }

        final Pair currentPair = keys.get(position);

        for (int i = 0; i <= remaining / currentPair.val && i <= currentPair.count; i++) {
            acc.add(new Pair(currentPair.val, i));
            result.addAll(solve(keys, position + 1, remaining - currentPair.val * i, acc));
            acc.remove(acc.size() - 1);
        }
        return result;
    } solve {
        List<List<Pair>> result = new ArrayList<>();
        if (position == keys.size()) {

            if (remaining == 0) {
                result.add(new ArrayList<>(acc));
            }
            return result;
        }

        final Pair currentPair = keys.get(position);

        for (int i = 0; i <= remaining / currentPair.val && i <= currentPair.count; i++) {
            acc.add(new Pair(currentPair.val, i));
            result.addAll(solve(keys, position + 1, remaining - currentPair.val * i, acc));
            acc.remove(acc.size() - 1);
        }
        return result;
    } List<List<Pair>> result = new ArrayList<>(); result new ArrayList<>() if (position == keys.size()) {

            if (remaining == 0) {
                result.add(new ArrayList<>(acc));
            }
            return result;
        } position == keys.size() position keys.size() keys.size keys {

            if (remaining == 0) {
                result.add(new ArrayList<>(acc));
            }
            return result;
        } if (remaining == 0) {
                result.add(new ArrayList<>(acc));
            } remaining == 0 remaining 0 {
                result.add(new ArrayList<>(acc));
            } result.add(new ArrayList<>(acc)) result.add result new ArrayList<>(acc) return result; result final Pair currentPair = keys.get(position); currentPair keys.get(position) keys.get keys position for (int i = 0; i <= remaining / currentPair.val && i <= currentPair.count; i++) {
            acc.add(new Pair(currentPair.val, i));
            result.addAll(solve(keys, position + 1, remaining - currentPair.val * i, acc));
            acc.remove(acc.size() - 1);
        } int i = 0; int i = 0; i 0 i <= remaining / currentPair.val && i <= currentPair.count i <= remaining / currentPair.val i remaining / currentPair.val remaining currentPair.val currentPair currentPair.val i <= currentPair.count i currentPair.count currentPair currentPair.count i++ i++ i {
            acc.add(new Pair(currentPair.val, i));
            result.addAll(solve(keys, position + 1, remaining - currentPair.val * i, acc));
            acc.remove(acc.size() - 1);
        } {
            acc.add(new Pair(currentPair.val, i));
            result.addAll(solve(keys, position + 1, remaining - currentPair.val * i, acc));
            acc.remove(acc.size() - 1);
        } acc.add(new Pair(currentPair.val, i)) acc.add acc new Pair(currentPair.val, i) result.addAll(solve(keys, position + 1, remaining - currentPair.val * i, acc)) result.addAll result solve(keys, position + 1, remaining - currentPair.val * i, acc) solve keys position + 1 position 1 remaining - currentPair.val * i remaining currentPair.val * i currentPair.val currentPair currentPair.val i acc acc.remove(acc.size() - 1) acc.remove acc acc.size() - 1 acc.size() acc.size acc 1 return result; result List<Pair> keys keys int position position int remaining remaining List<Pair> acc acc static class Pair {
        int val;
        int count;

        public Pair(int val, int count) {
            this.val = val;
            this.count = count;
        }
    } Pair int val; val int count; count public Pair(int val, int count) {
            this.val = val;
            this.count = count;
        } Pair {
            this.val = val;
            this.count = count;
        } this.val = val this.val this this.val val this.count = count this.count this this.count count int val val int count count public class Main {
    static String INPUT = "";

    public static void main(String[] args) {
        InputStream is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());

        Scanner scanner = new Scanner(is);

        final int fiveHundred = scanner.nextInt();
        final int hundred = scanner.nextInt();
        final int fifty = scanner.nextInt();
        final int x = scanner.nextInt();
        List<Pair> keys = new ArrayList<>();
        keys.add(new Pair(500, fiveHundred));
        keys.add(new Pair(100, hundred));
        keys.add(new Pair(50, fifty));
        final List<List<Pair>> result = solve(keys, 0, x, new ArrayList<>());
        System.out.println(result.size());
    }

    static class Pair {
        int val;
        int count;

        public Pair(int val, int count) {
            this.val = val;
            this.count = count;
        }
    }

    static List<List<Pair>> solve(List<Pair> keys, int position, int remaining, List<Pair> acc) {
        List<List<Pair>> result = new ArrayList<>();
        if (position == keys.size()) {

            if (remaining == 0) {
                result.add(new ArrayList<>(acc));
            }
            return result;
        }

        final Pair currentPair = keys.get(position);

        for (int i = 0; i <= remaining / currentPair.val && i <= currentPair.count; i++) {
            acc.add(new Pair(currentPair.val, i));
            result.addAll(solve(keys, position + 1, remaining - currentPair.val * i, acc));
            acc.remove(acc.size() - 1);
        }
        return result;
    }

} public class Main {
    static String INPUT = "";

    public static void main(String[] args) {
        InputStream is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());

        Scanner scanner = new Scanner(is);

        final int fiveHundred = scanner.nextInt();
        final int hundred = scanner.nextInt();
        final int fifty = scanner.nextInt();
        final int x = scanner.nextInt();
        List<Pair> keys = new ArrayList<>();
        keys.add(new Pair(500, fiveHundred));
        keys.add(new Pair(100, hundred));
        keys.add(new Pair(50, fifty));
        final List<List<Pair>> result = solve(keys, 0, x, new ArrayList<>());
        System.out.println(result.size());
    }

    static class Pair {
        int val;
        int count;

        public Pair(int val, int count) {
            this.val = val;
            this.count = count;
        }
    }

    static List<List<Pair>> solve(List<Pair> keys, int position, int remaining, List<Pair> acc) {
        List<List<Pair>> result = new ArrayList<>();
        if (position == keys.size()) {

            if (remaining == 0) {
                result.add(new ArrayList<>(acc));
            }
            return result;
        }

        final Pair currentPair = keys.get(position);

        for (int i = 0; i <= remaining / currentPair.val && i <= currentPair.count; i++) {
            acc.add(new Pair(currentPair.val, i));
            result.addAll(solve(keys, position + 1, remaining - currentPair.val * i, acc));
            acc.remove(acc.size() - 1);
        }
        return result;
    }

} Main
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    static String INPUT = "";

    public static void main(String[] args) {
        InputStream is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());

        Scanner scanner = new Scanner(is);

        final int fiveHundred = scanner.nextInt();
        final int hundred = scanner.nextInt();
        final int fifty = scanner.nextInt();
        final int x = scanner.nextInt();
        List<Pair> keys = new ArrayList<>();
        keys.add(new Pair(500, fiveHundred));
        keys.add(new Pair(100, hundred));
        keys.add(new Pair(50, fifty));
        final List<List<Pair>> result = solve(keys, 0, x, new ArrayList<>());
        System.out.println(result.size());
    }

    static class Pair {
        int val;
        int count;

        public Pair(int val, int count) {
            this.val = val;
            this.count = count;
        }
    }

    static List<List<Pair>> solve(List<Pair> keys, int position, int remaining, List<Pair> acc) {
        List<List<Pair>> result = new ArrayList<>();
        if (position == keys.size()) {

            if (remaining == 0) {
                result.add(new ArrayList<>(acc));
            }
            return result;
        }

        final Pair currentPair = keys.get(position);

        for (int i = 0; i <= remaining / currentPair.val && i <= currentPair.count; i++) {
            acc.add(new Pair(currentPair.val, i));
            result.addAll(solve(keys, position + 1, remaining - currentPair.val * i, acc));
            acc.remove(acc.size() - 1);
        }
        return result;
    }

}
