import java.util.Scanner;

//  B - Coins

public class Main {
  public static void main(String[] args ) throws Exception {
	final int GOHYAKU = 500;
	final int HYAKU = 100;
	final int GOJU = 50;

    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int D = Integer.parseInt(sc.next());
    int count = 0;

    for(int i = 0; i <= A; i++) {
    	if(i*GOHYAKU == D) {
//    		System.out.println();
    		count++;
    	}
    	for(int m = 0; m <= B; m++) {
    		if((i*GOHYAKU + m * HYAKU == D) && m != 0) {
				count++;
    		}
    		for(int n = 0; n <= C; n++) {
				if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				}
    		}
    	}
    }

    System.out.println(count);

  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args ) throws Exception {
	final int GOHYAKU = 500;
	final int HYAKU = 100;
	final int GOJU = 50;

    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int D = Integer.parseInt(sc.next());
    int count = 0;

    for(int i = 0; i <= A; i++) {
    	if(i*GOHYAKU == D) {
//    		System.out.println();
    		count++;
    	}
    	for(int m = 0; m <= B; m++) {
    		if((i*GOHYAKU + m * HYAKU == D) && m != 0) {
				count++;
    		}
    		for(int n = 0; n <= C; n++) {
				if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				}
    		}
    	}
    }

    System.out.println(count);

  }
} Main public static void main(String[] args ) throws Exception {
	final int GOHYAKU = 500;
	final int HYAKU = 100;
	final int GOJU = 50;

    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int D = Integer.parseInt(sc.next());
    int count = 0;

    for(int i = 0; i <= A; i++) {
    	if(i*GOHYAKU == D) {
//    		System.out.println();
    		count++;
    	}
    	for(int m = 0; m <= B; m++) {
    		if((i*GOHYAKU + m * HYAKU == D) && m != 0) {
				count++;
    		}
    		for(int n = 0; n <= C; n++) {
				if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				}
    		}
    	}
    }

    System.out.println(count);

  } main {
	final int GOHYAKU = 500;
	final int HYAKU = 100;
	final int GOJU = 50;

    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int D = Integer.parseInt(sc.next());
    int count = 0;

    for(int i = 0; i <= A; i++) {
    	if(i*GOHYAKU == D) {
//    		System.out.println();
    		count++;
    	}
    	for(int m = 0; m <= B; m++) {
    		if((i*GOHYAKU + m * HYAKU == D) && m != 0) {
				count++;
    		}
    		for(int n = 0; n <= C; n++) {
				if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				}
    		}
    	}
    }

    System.out.println(count);

  } final int GOHYAKU = 500; GOHYAKU 500 final int HYAKU = 100; HYAKU 100 final int GOJU = 50; GOJU 50 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int C = Integer.parseInt(sc.next()); C Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int D = Integer.parseInt(sc.next()); D Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int count = 0; count 0 for(int i = 0; i <= A; i++) {
    	if(i*GOHYAKU == D) {
//    		System.out.println();
    		count++;
    	}
    	for(int m = 0; m <= B; m++) {
    		if((i*GOHYAKU + m * HYAKU == D) && m != 0) {
				count++;
    		}
    		for(int n = 0; n <= C; n++) {
				if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				}
    		}
    	}
    } int i = 0; int i = 0; i 0 i <= A i A i++ i++ i {
    	if(i*GOHYAKU == D) {
//    		System.out.println();
    		count++;
    	}
    	for(int m = 0; m <= B; m++) {
    		if((i*GOHYAKU + m * HYAKU == D) && m != 0) {
				count++;
    		}
    		for(int n = 0; n <= C; n++) {
				if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				}
    		}
    	}
    } {
    	if(i*GOHYAKU == D) {
//    		System.out.println();
    		count++;
    	}
    	for(int m = 0; m <= B; m++) {
    		if((i*GOHYAKU + m * HYAKU == D) && m != 0) {
				count++;
    		}
    		for(int n = 0; n <= C; n++) {
				if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				}
    		}
    	}
    } if(i*GOHYAKU == D) {
//    		System.out.println();
    		count++;
    	} i*GOHYAKU == D i*GOHYAKU i GOHYAKU D {
//    		System.out.println();
    		count++;
    	} count++ count for(int m = 0; m <= B; m++) {
    		if((i*GOHYAKU + m * HYAKU == D) && m != 0) {
				count++;
    		}
    		for(int n = 0; n <= C; n++) {
				if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				}
    		}
    	} int m = 0; int m = 0; m 0 m <= B m B m++ m++ m {
    		if((i*GOHYAKU + m * HYAKU == D) && m != 0) {
				count++;
    		}
    		for(int n = 0; n <= C; n++) {
				if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				}
    		}
    	} {
    		if((i*GOHYAKU + m * HYAKU == D) && m != 0) {
				count++;
    		}
    		for(int n = 0; n <= C; n++) {
				if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				}
    		}
    	} if((i*GOHYAKU + m * HYAKU == D) && m != 0) {
				count++;
    		} (i*GOHYAKU + m * HYAKU == D) && m != 0 (i*GOHYAKU + m * HYAKU == D) i*GOHYAKU + m * HYAKU i*GOHYAKU i GOHYAKU m * HYAKU m HYAKU D m != 0 m 0 {
				count++;
    		} count++ count for(int n = 0; n <= C; n++) {
				if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				}
    		} int n = 0; int n = 0; n 0 n <= C n C n++ n++ n {
				if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				}
    		} {
				if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				}
    		} if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				} (i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0 (i*GOHYAKU + m * HYAKU + n * GOJU == D) i*GOHYAKU + m * HYAKU + n * GOJU i*GOHYAKU + m * HYAKU + n * GOJU i*GOHYAKU i GOHYAKU m * HYAKU m HYAKU n * GOJU n GOJU D n != 0 n 0 {
					count++;
				} count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
  public static void main(String[] args ) throws Exception {
	final int GOHYAKU = 500;
	final int HYAKU = 100;
	final int GOJU = 50;

    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int D = Integer.parseInt(sc.next());
    int count = 0;

    for(int i = 0; i <= A; i++) {
    	if(i*GOHYAKU == D) {
//    		System.out.println();
    		count++;
    	}
    	for(int m = 0; m <= B; m++) {
    		if((i*GOHYAKU + m * HYAKU == D) && m != 0) {
				count++;
    		}
    		for(int n = 0; n <= C; n++) {
				if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				}
    		}
    	}
    }

    System.out.println(count);

  }
} public class Main {
  public static void main(String[] args ) throws Exception {
	final int GOHYAKU = 500;
	final int HYAKU = 100;
	final int GOJU = 50;

    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int D = Integer.parseInt(sc.next());
    int count = 0;

    for(int i = 0; i <= A; i++) {
    	if(i*GOHYAKU == D) {
//    		System.out.println();
    		count++;
    	}
    	for(int m = 0; m <= B; m++) {
    		if((i*GOHYAKU + m * HYAKU == D) && m != 0) {
				count++;
    		}
    		for(int n = 0; n <= C; n++) {
				if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				}
    		}
    	}
    }

    System.out.println(count);

  }
} Main
import java.util.Scanner;

//  B - Coins

public class Main {
  public static void main(String[] args ) throws Exception {
	final int GOHYAKU = 500;
	final int HYAKU = 100;
	final int GOJU = 50;

    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int D = Integer.parseInt(sc.next());
    int count = 0;

    for(int i = 0; i <= A; i++) {
    	if(i*GOHYAKU == D) {
//    		System.out.println();
    		count++;
    	}
    	for(int m = 0; m <= B; m++) {
    		if((i*GOHYAKU + m * HYAKU == D) && m != 0) {
				count++;
    		}
    		for(int n = 0; n <= C; n++) {
				if((i*GOHYAKU + m * HYAKU + n * GOJU == D) && n != 0) {
					count++;
				}
    		}
    	}
    }

    System.out.println(count);

  }
}