import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int yen500 = sc.nextInt();
		int yen100 = sc.nextInt();
		int yen50 = sc.nextInt();
		int value = sc.nextInt();
		
		int max500 = value / 500 < yen500 ? value / 500 : yen500;
		int max100;
		int result = 0;
		int nokori500;
		int nokori100;

		
		for (int i = 0; i <= max500; i++) {
			nokori500  = value - 500 * i;
			max100  = nokori500 / 100 < yen100 ? nokori500 / 100 : yen100;
			for (int j = 0; j <= max100; j++) {
				nokori100 = nokori500 - 100 * j;
				if (nokori100 % 50 == 0) {
					if (nokori100 / 50 <= yen50) {
						result++;						
					}
				}
			}
		}
		
		System.out.println(result);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int yen500 = sc.nextInt();
		int yen100 = sc.nextInt();
		int yen50 = sc.nextInt();
		int value = sc.nextInt();
		
		int max500 = value / 500 < yen500 ? value / 500 : yen500;
		int max100;
		int result = 0;
		int nokori500;
		int nokori100;

		
		for (int i = 0; i <= max500; i++) {
			nokori500  = value - 500 * i;
			max100  = nokori500 / 100 < yen100 ? nokori500 / 100 : yen100;
			for (int j = 0; j <= max100; j++) {
				nokori100 = nokori500 - 100 * j;
				if (nokori100 % 50 == 0) {
					if (nokori100 / 50 <= yen50) {
						result++;						
					}
				}
			}
		}
		
		System.out.println(result);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int yen500 = sc.nextInt();
		int yen100 = sc.nextInt();
		int yen50 = sc.nextInt();
		int value = sc.nextInt();
		
		int max500 = value / 500 < yen500 ? value / 500 : yen500;
		int max100;
		int result = 0;
		int nokori500;
		int nokori100;

		
		for (int i = 0; i <= max500; i++) {
			nokori500  = value - 500 * i;
			max100  = nokori500 / 100 < yen100 ? nokori500 / 100 : yen100;
			for (int j = 0; j <= max100; j++) {
				nokori100 = nokori500 - 100 * j;
				if (nokori100 % 50 == 0) {
					if (nokori100 / 50 <= yen50) {
						result++;						
					}
				}
			}
		}
		
		System.out.println(result);
	} main {
		Scanner sc = new Scanner(System.in);
		int yen500 = sc.nextInt();
		int yen100 = sc.nextInt();
		int yen50 = sc.nextInt();
		int value = sc.nextInt();
		
		int max500 = value / 500 < yen500 ? value / 500 : yen500;
		int max100;
		int result = 0;
		int nokori500;
		int nokori100;

		
		for (int i = 0; i <= max500; i++) {
			nokori500  = value - 500 * i;
			max100  = nokori500 / 100 < yen100 ? nokori500 / 100 : yen100;
			for (int j = 0; j <= max100; j++) {
				nokori100 = nokori500 - 100 * j;
				if (nokori100 % 50 == 0) {
					if (nokori100 / 50 <= yen50) {
						result++;						
					}
				}
			}
		}
		
		System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int yen500 = sc.nextInt(); yen500 sc.nextInt() sc.nextInt sc int yen100 = sc.nextInt(); yen100 sc.nextInt() sc.nextInt sc int yen50 = sc.nextInt(); yen50 sc.nextInt() sc.nextInt sc int value = sc.nextInt(); value sc.nextInt() sc.nextInt sc int max500 = value / 500 < yen500 ? value / 500 : yen500; max500 value / 500 < yen500 ? value / 500 : yen500 value / 500 < yen500 value / 500 value 500 yen500 value / 500 value 500 yen500 int max100; max100 int result = 0; result 0 int nokori500; nokori500 int nokori100; nokori100 for (int i = 0; i <= max500; i++) {
			nokori500  = value - 500 * i;
			max100  = nokori500 / 100 < yen100 ? nokori500 / 100 : yen100;
			for (int j = 0; j <= max100; j++) {
				nokori100 = nokori500 - 100 * j;
				if (nokori100 % 50 == 0) {
					if (nokori100 / 50 <= yen50) {
						result++;						
					}
				}
			}
		} int i = 0; int i = 0; i 0 i <= max500 i max500 i++ i++ i {
			nokori500  = value - 500 * i;
			max100  = nokori500 / 100 < yen100 ? nokori500 / 100 : yen100;
			for (int j = 0; j <= max100; j++) {
				nokori100 = nokori500 - 100 * j;
				if (nokori100 % 50 == 0) {
					if (nokori100 / 50 <= yen50) {
						result++;						
					}
				}
			}
		} {
			nokori500  = value - 500 * i;
			max100  = nokori500 / 100 < yen100 ? nokori500 / 100 : yen100;
			for (int j = 0; j <= max100; j++) {
				nokori100 = nokori500 - 100 * j;
				if (nokori100 % 50 == 0) {
					if (nokori100 / 50 <= yen50) {
						result++;						
					}
				}
			}
		} nokori500  = value - 500 * i nokori500 value - 500 * i value 500 * i 500 i max100  = nokori500 / 100 < yen100 ? nokori500 / 100 : yen100 max100 nokori500 / 100 < yen100 ? nokori500 / 100 : yen100 nokori500 / 100 < yen100 nokori500 / 100 nokori500 100 yen100 nokori500 / 100 nokori500 100 yen100 for (int j = 0; j <= max100; j++) {
				nokori100 = nokori500 - 100 * j;
				if (nokori100 % 50 == 0) {
					if (nokori100 / 50 <= yen50) {
						result++;						
					}
				}
			} int j = 0; int j = 0; j 0 j <= max100 j max100 j++ j++ j {
				nokori100 = nokori500 - 100 * j;
				if (nokori100 % 50 == 0) {
					if (nokori100 / 50 <= yen50) {
						result++;						
					}
				}
			} {
				nokori100 = nokori500 - 100 * j;
				if (nokori100 % 50 == 0) {
					if (nokori100 / 50 <= yen50) {
						result++;						
					}
				}
			} nokori100 = nokori500 - 100 * j nokori100 nokori500 - 100 * j nokori500 100 * j 100 j if (nokori100 % 50 == 0) {
					if (nokori100 / 50 <= yen50) {
						result++;						
					}
				} nokori100 % 50 == 0 nokori100 % 50 nokori100 50 0 {
					if (nokori100 / 50 <= yen50) {
						result++;						
					}
				} if (nokori100 / 50 <= yen50) {
						result++;						
					} nokori100 / 50 <= yen50 nokori100 / 50 nokori100 50 yen50 {
						result++;						
					} result++ result System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int yen500 = sc.nextInt();
		int yen100 = sc.nextInt();
		int yen50 = sc.nextInt();
		int value = sc.nextInt();
		
		int max500 = value / 500 < yen500 ? value / 500 : yen500;
		int max100;
		int result = 0;
		int nokori500;
		int nokori100;

		
		for (int i = 0; i <= max500; i++) {
			nokori500  = value - 500 * i;
			max100  = nokori500 / 100 < yen100 ? nokori500 / 100 : yen100;
			for (int j = 0; j <= max100; j++) {
				nokori100 = nokori500 - 100 * j;
				if (nokori100 % 50 == 0) {
					if (nokori100 / 50 <= yen50) {
						result++;						
					}
				}
			}
		}
		
		System.out.println(result);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int yen500 = sc.nextInt();
		int yen100 = sc.nextInt();
		int yen50 = sc.nextInt();
		int value = sc.nextInt();
		
		int max500 = value / 500 < yen500 ? value / 500 : yen500;
		int max100;
		int result = 0;
		int nokori500;
		int nokori100;

		
		for (int i = 0; i <= max500; i++) {
			nokori500  = value - 500 * i;
			max100  = nokori500 / 100 < yen100 ? nokori500 / 100 : yen100;
			for (int j = 0; j <= max100; j++) {
				nokori100 = nokori500 - 100 * j;
				if (nokori100 % 50 == 0) {
					if (nokori100 / 50 <= yen50) {
						result++;						
					}
				}
			}
		}
		
		System.out.println(result);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int yen500 = sc.nextInt();
		int yen100 = sc.nextInt();
		int yen50 = sc.nextInt();
		int value = sc.nextInt();
		
		int max500 = value / 500 < yen500 ? value / 500 : yen500;
		int max100;
		int result = 0;
		int nokori500;
		int nokori100;

		
		for (int i = 0; i <= max500; i++) {
			nokori500  = value - 500 * i;
			max100  = nokori500 / 100 < yen100 ? nokori500 / 100 : yen100;
			for (int j = 0; j <= max100; j++) {
				nokori100 = nokori500 - 100 * j;
				if (nokori100 % 50 == 0) {
					if (nokori100 / 50 <= yen50) {
						result++;						
					}
				}
			}
		}
		
		System.out.println(result);
	}
}
