import java.util.Scanner;

/**
 * 【問題概要】 500 円玉を AA 枚、100 円玉を BB 枚、50 円玉を CC 枚持っています。これらの硬貨の中から何枚かを選び、合計金額をちょうど
 * XX 円にする方法は何通りあるでしょうか？
 *
 * @author tsuch
 *
 */
public class Main {

	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		Main instance = new Main();
		instance.solve();
	}

	private void solve() {
		try {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int x = sc.nextInt();

			int count = 0;

			for (int i = 0; i < x / 500 + 1 && i <= a; i++) {
				for (int j = 0; j < x / 100 + 1 && j <= b; j++) {
					for (int k = 0; k < x / 50 + 1 && k <= c; k++) {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					}
				}
			}
			System.out.println(count);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		Main instance = new Main();
		instance.solve();
	}

	private void solve() {
		try {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int x = sc.nextInt();

			int count = 0;

			for (int i = 0; i < x / 500 + 1 && i <= a; i++) {
				for (int j = 0; j < x / 100 + 1 && j <= b; j++) {
					for (int k = 0; k < x / 50 + 1 && k <= c; k++) {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					}
				}
			}
			System.out.println(count);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
} Main private static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
		Main instance = new Main();
		instance.solve();
	} main {
		Main instance = new Main();
		instance.solve();
	} Main instance = new Main(); instance new Main() instance.solve() instance.solve instance String[] args args private void solve() {
		try {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int x = sc.nextInt();

			int count = 0;

			for (int i = 0; i < x / 500 + 1 && i <= a; i++) {
				for (int j = 0; j < x / 100 + 1 && j <= b; j++) {
					for (int k = 0; k < x / 50 + 1 && k <= c; k++) {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					}
				}
			}
			System.out.println(count);

		} catch (Exception e) {
			e.printStackTrace();
		}
	} solve {
		try {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int x = sc.nextInt();

			int count = 0;

			for (int i = 0; i < x / 500 + 1 && i <= a; i++) {
				for (int j = 0; j < x / 100 + 1 && j <= b; j++) {
					for (int k = 0; k < x / 50 + 1 && k <= c; k++) {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					}
				}
			}
			System.out.println(count);

		} catch (Exception e) {
			e.printStackTrace();
		}
	} try {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int x = sc.nextInt();

			int count = 0;

			for (int i = 0; i < x / 500 + 1 && i <= a; i++) {
				for (int j = 0; j < x / 100 + 1 && j <= b; j++) {
					for (int k = 0; k < x / 50 + 1 && k <= c; k++) {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					}
				}
			}
			System.out.println(count);

		} catch (Exception e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int x = sc.nextInt();

			int count = 0;

			for (int i = 0; i < x / 500 + 1 && i <= a; i++) {
				for (int j = 0; j < x / 100 + 1 && j <= b; j++) {
					for (int k = 0; k < x / 50 + 1 && k <= c; k++) {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					}
				}
			}
			System.out.println(count);

		} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int count = 0; count 0 for (int i = 0; i < x / 500 + 1 && i <= a; i++) {
				for (int j = 0; j < x / 100 + 1 && j <= b; j++) {
					for (int k = 0; k < x / 50 + 1 && k <= c; k++) {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					}
				}
			} int i = 0; int i = 0; i 0 i < x / 500 + 1 && i <= a i < x / 500 + 1 i x / 500 + 1 x / 500 x 500 1 i <= a i a i++ i++ i {
				for (int j = 0; j < x / 100 + 1 && j <= b; j++) {
					for (int k = 0; k < x / 50 + 1 && k <= c; k++) {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					}
				}
			} {
				for (int j = 0; j < x / 100 + 1 && j <= b; j++) {
					for (int k = 0; k < x / 50 + 1 && k <= c; k++) {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					}
				}
			} for (int j = 0; j < x / 100 + 1 && j <= b; j++) {
					for (int k = 0; k < x / 50 + 1 && k <= c; k++) {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					}
				} int j = 0; int j = 0; j 0 j < x / 100 + 1 && j <= b j < x / 100 + 1 j x / 100 + 1 x / 100 x 100 1 j <= b j b j++ j++ j {
					for (int k = 0; k < x / 50 + 1 && k <= c; k++) {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					}
				} {
					for (int k = 0; k < x / 50 + 1 && k <= c; k++) {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					}
				} for (int k = 0; k < x / 50 + 1 && k <= c; k++) {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					} int k = 0; int k = 0; k 0 k < x / 50 + 1 && k <= c k < x / 50 + 1 k x / 50 + 1 x / 50 x 50 1 k <= c k c k++ k++ k {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					} {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					} if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						} x == 500 * i + 100 * j + 50 * k x 500 * i + 100 * j + 50 * k 500 * i + 100 * j + 50 * k 500 * i 500 i 100 * j 100 j 50 * k 50 k {
							count++;
						} count++ count System.out.println(count) System.out.println System.out System System.out count public class Main {

	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		Main instance = new Main();
		instance.solve();
	}

	private void solve() {
		try {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int x = sc.nextInt();

			int count = 0;

			for (int i = 0; i < x / 500 + 1 && i <= a; i++) {
				for (int j = 0; j < x / 100 + 1 && j <= b; j++) {
					for (int k = 0; k < x / 50 + 1 && k <= c; k++) {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					}
				}
			}
			System.out.println(count);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
} public class Main {

	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		Main instance = new Main();
		instance.solve();
	}

	private void solve() {
		try {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int x = sc.nextInt();

			int count = 0;

			for (int i = 0; i < x / 500 + 1 && i <= a; i++) {
				for (int j = 0; j < x / 100 + 1 && j <= b; j++) {
					for (int k = 0; k < x / 50 + 1 && k <= c; k++) {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					}
				}
			}
			System.out.println(count);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
} Main
import java.util.Scanner;

/**
 * 【問題概要】 500 円玉を AA 枚、100 円玉を BB 枚、50 円玉を CC 枚持っています。これらの硬貨の中から何枚かを選び、合計金額をちょうど
 * XX 円にする方法は何通りあるでしょうか？
 *
 * @author tsuch
 *
 */
public class Main {

	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		Main instance = new Main();
		instance.solve();
	}

	private void solve() {
		try {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int x = sc.nextInt();

			int count = 0;

			for (int i = 0; i < x / 500 + 1 && i <= a; i++) {
				for (int j = 0; j < x / 100 + 1 && j <= b; j++) {
					for (int k = 0; k < x / 50 + 1 && k <= c; k++) {
						if (x == 500 * i + 100 * j + 50 * k) {
							count++;
						}
					}
				}
			}
			System.out.println(count);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}