
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		// [0]:500円, [1]:100円, [2]:50円, [3]:合計
		int[] coin = new int[4];
		Scanner sc = new Scanner(System.in);
		for (int i = 0; i < 4; i++) {
			coin[i] = sc.nextInt();
		}
		sc.close();
		System.out.println(calc(coin));
	}

	public static int calc(int[] a) {
		int[] coin = a;
		int count = 0;
		for (int i = 0; i <= coin[0]; i++) { //500円
			for (int j = 0; j <= coin[1]; j++) { //100円
				for (int k = 0; k <= coin[2]; k++) {//10円
					count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0;
				}
			}
		}
		return count;
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {

		// [0]:500円, [1]:100円, [2]:50円, [3]:合計
		int[] coin = new int[4];
		Scanner sc = new Scanner(System.in);
		for (int i = 0; i < 4; i++) {
			coin[i] = sc.nextInt();
		}
		sc.close();
		System.out.println(calc(coin));
	}

	public static int calc(int[] a) {
		int[] coin = a;
		int count = 0;
		for (int i = 0; i <= coin[0]; i++) { //500円
			for (int j = 0; j <= coin[1]; j++) { //100円
				for (int k = 0; k <= coin[2]; k++) {//10円
					count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0;
				}
			}
		}
		return count;
	}

} Main public static void main(String[] args) {

		// [0]:500円, [1]:100円, [2]:50円, [3]:合計
		int[] coin = new int[4];
		Scanner sc = new Scanner(System.in);
		for (int i = 0; i < 4; i++) {
			coin[i] = sc.nextInt();
		}
		sc.close();
		System.out.println(calc(coin));
	} main {

		// [0]:500円, [1]:100円, [2]:50円, [3]:合計
		int[] coin = new int[4];
		Scanner sc = new Scanner(System.in);
		for (int i = 0; i < 4; i++) {
			coin[i] = sc.nextInt();
		}
		sc.close();
		System.out.println(calc(coin));
	} int[] coin = new int[4]; coin new int[4] 4 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) for (int i = 0; i < 4; i++) {
			coin[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
			coin[i] = sc.nextInt();
		} {
			coin[i] = sc.nextInt();
		} coin[i] = sc.nextInt() coin[i] coin i sc.nextInt() sc.nextInt sc sc.close() sc.close sc System.out.println(calc(coin)) System.out.println System.out System System.out calc(coin) calc coin String[] args args public static int calc(int[] a) {
		int[] coin = a;
		int count = 0;
		for (int i = 0; i <= coin[0]; i++) { //500円
			for (int j = 0; j <= coin[1]; j++) { //100円
				for (int k = 0; k <= coin[2]; k++) {//10円
					count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0;
				}
			}
		}
		return count;
	} calc {
		int[] coin = a;
		int count = 0;
		for (int i = 0; i <= coin[0]; i++) { //500円
			for (int j = 0; j <= coin[1]; j++) { //100円
				for (int k = 0; k <= coin[2]; k++) {//10円
					count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0;
				}
			}
		}
		return count;
	} int[] coin = a; coin a int count = 0; count 0 for (int i = 0; i <= coin[0]; i++) { //500円
			for (int j = 0; j <= coin[1]; j++) { //100円
				for (int k = 0; k <= coin[2]; k++) {//10円
					count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0;
				}
			}
		} int i = 0; int i = 0; i 0 i <= coin[0] i coin[0] coin 0 i++ i++ i { //500円
			for (int j = 0; j <= coin[1]; j++) { //100円
				for (int k = 0; k <= coin[2]; k++) {//10円
					count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0;
				}
			}
		} { //500円
			for (int j = 0; j <= coin[1]; j++) { //100円
				for (int k = 0; k <= coin[2]; k++) {//10円
					count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0;
				}
			}
		} for (int j = 0; j <= coin[1]; j++) { //100円
				for (int k = 0; k <= coin[2]; k++) {//10円
					count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0;
				}
			} int j = 0; int j = 0; j 0 j <= coin[1] j coin[1] coin 1 j++ j++ j { //100円
				for (int k = 0; k <= coin[2]; k++) {//10円
					count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0;
				}
			} { //100円
				for (int k = 0; k <= coin[2]; k++) {//10円
					count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0;
				}
			} for (int k = 0; k <= coin[2]; k++) {//10円
					count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0;
				} int k = 0; int k = 0; k 0 k <= coin[2] k coin[2] coin 2 k++ k++ k {//10円
					count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0;
				} {//10円
					count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0;
				} count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0 count (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0 (500 * i + 100 * j + 50 * k) == coin[3] (500 * i + 100 * j + 50 * k) 500 * i + 100 * j + 50 * k 500 * i 500 i 100 * j 100 j 50 * k 50 k coin[3] coin 3 1 0 return count; count int[] a a public class Main {
	public static void main(String[] args) {

		// [0]:500円, [1]:100円, [2]:50円, [3]:合計
		int[] coin = new int[4];
		Scanner sc = new Scanner(System.in);
		for (int i = 0; i < 4; i++) {
			coin[i] = sc.nextInt();
		}
		sc.close();
		System.out.println(calc(coin));
	}

	public static int calc(int[] a) {
		int[] coin = a;
		int count = 0;
		for (int i = 0; i <= coin[0]; i++) { //500円
			for (int j = 0; j <= coin[1]; j++) { //100円
				for (int k = 0; k <= coin[2]; k++) {//10円
					count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0;
				}
			}
		}
		return count;
	}

} public class Main {
	public static void main(String[] args) {

		// [0]:500円, [1]:100円, [2]:50円, [3]:合計
		int[] coin = new int[4];
		Scanner sc = new Scanner(System.in);
		for (int i = 0; i < 4; i++) {
			coin[i] = sc.nextInt();
		}
		sc.close();
		System.out.println(calc(coin));
	}

	public static int calc(int[] a) {
		int[] coin = a;
		int count = 0;
		for (int i = 0; i <= coin[0]; i++) { //500円
			for (int j = 0; j <= coin[1]; j++) { //100円
				for (int k = 0; k <= coin[2]; k++) {//10円
					count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0;
				}
			}
		}
		return count;
	}

} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		// [0]:500円, [1]:100円, [2]:50円, [3]:合計
		int[] coin = new int[4];
		Scanner sc = new Scanner(System.in);
		for (int i = 0; i < 4; i++) {
			coin[i] = sc.nextInt();
		}
		sc.close();
		System.out.println(calc(coin));
	}

	public static int calc(int[] a) {
		int[] coin = a;
		int count = 0;
		for (int i = 0; i <= coin[0]; i++) { //500円
			for (int j = 0; j <= coin[1]; j++) { //100円
				for (int k = 0; k <= coin[2]; k++) {//10円
					count += (500 * i + 100 * j + 50 * k) == coin[3] ? 1 : 0;
				}
			}
		}
		return count;
	}

}
