import java.util.Scanner;

public class Main {
    private static int ROW = 3;
    private static int[] VALUES = {500, 100, 50};
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] coins = new int[ROW];
        for (int i = 0; i < ROW; i++) {
            coins[i] = sc.nextInt();
        }
        int x = sc.nextInt();
        int cnt = 0;

        for (int n500 = 0; n500 <= coins[0]; n500++) {
            if (n500 * 500 > x) {
                continue;
            }
            for (int n100 = 0; n100 <= coins[1]; n100++) {
                if (n100 * 100 > x) {
                    continue;
                }
                for (int n50 = 0; n50 <= coins[2]; n50++) {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                }
            }
        }
        System.out.println(cnt);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    private static int ROW = 3;
    private static int[] VALUES = {500, 100, 50};
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] coins = new int[ROW];
        for (int i = 0; i < ROW; i++) {
            coins[i] = sc.nextInt();
        }
        int x = sc.nextInt();
        int cnt = 0;

        for (int n500 = 0; n500 <= coins[0]; n500++) {
            if (n500 * 500 > x) {
                continue;
            }
            for (int n100 = 0; n100 <= coins[1]; n100++) {
                if (n100 * 100 > x) {
                    continue;
                }
                for (int n50 = 0; n50 <= coins[2]; n50++) {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                }
            }
        }
        System.out.println(cnt);
    }
} Main private static int ROW = 3; ROW 3 private static int[] VALUES = {500, 100, 50}; VALUES {500, 100, 50} 500 100 50 public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] coins = new int[ROW];
        for (int i = 0; i < ROW; i++) {
            coins[i] = sc.nextInt();
        }
        int x = sc.nextInt();
        int cnt = 0;

        for (int n500 = 0; n500 <= coins[0]; n500++) {
            if (n500 * 500 > x) {
                continue;
            }
            for (int n100 = 0; n100 <= coins[1]; n100++) {
                if (n100 * 100 > x) {
                    continue;
                }
                for (int n50 = 0; n50 <= coins[2]; n50++) {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                }
            }
        }
        System.out.println(cnt);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] coins = new int[ROW];
        for (int i = 0; i < ROW; i++) {
            coins[i] = sc.nextInt();
        }
        int x = sc.nextInt();
        int cnt = 0;

        for (int n500 = 0; n500 <= coins[0]; n500++) {
            if (n500 * 500 > x) {
                continue;
            }
            for (int n100 = 0; n100 <= coins[1]; n100++) {
                if (n100 * 100 > x) {
                    continue;
                }
                for (int n50 = 0; n50 <= coins[2]; n50++) {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                }
            }
        }
        System.out.println(cnt);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] coins = new int[ROW]; coins new int[ROW] ROW for (int i = 0; i < ROW; i++) {
            coins[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < ROW i ROW i++ i++ i {
            coins[i] = sc.nextInt();
        } {
            coins[i] = sc.nextInt();
        } coins[i] = sc.nextInt() coins[i] coins i sc.nextInt() sc.nextInt sc int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int cnt = 0; cnt 0 for (int n500 = 0; n500 <= coins[0]; n500++) {
            if (n500 * 500 > x) {
                continue;
            }
            for (int n100 = 0; n100 <= coins[1]; n100++) {
                if (n100 * 100 > x) {
                    continue;
                }
                for (int n50 = 0; n50 <= coins[2]; n50++) {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                }
            }
        } int n500 = 0; int n500 = 0; n500 0 n500 <= coins[0] n500 coins[0] coins 0 n500++ n500++ n500 {
            if (n500 * 500 > x) {
                continue;
            }
            for (int n100 = 0; n100 <= coins[1]; n100++) {
                if (n100 * 100 > x) {
                    continue;
                }
                for (int n50 = 0; n50 <= coins[2]; n50++) {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                }
            }
        } {
            if (n500 * 500 > x) {
                continue;
            }
            for (int n100 = 0; n100 <= coins[1]; n100++) {
                if (n100 * 100 > x) {
                    continue;
                }
                for (int n50 = 0; n50 <= coins[2]; n50++) {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                }
            }
        } if (n500 * 500 > x) {
                continue;
            } n500 * 500 > x n500 * 500 n500 500 x {
                continue;
            } continue; for (int n100 = 0; n100 <= coins[1]; n100++) {
                if (n100 * 100 > x) {
                    continue;
                }
                for (int n50 = 0; n50 <= coins[2]; n50++) {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                }
            } int n100 = 0; int n100 = 0; n100 0 n100 <= coins[1] n100 coins[1] coins 1 n100++ n100++ n100 {
                if (n100 * 100 > x) {
                    continue;
                }
                for (int n50 = 0; n50 <= coins[2]; n50++) {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                }
            } {
                if (n100 * 100 > x) {
                    continue;
                }
                for (int n50 = 0; n50 <= coins[2]; n50++) {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                }
            } if (n100 * 100 > x) {
                    continue;
                } n100 * 100 > x n100 * 100 n100 100 x {
                    continue;
                } continue; for (int n50 = 0; n50 <= coins[2]; n50++) {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                } int n50 = 0; int n50 = 0; n50 0 n50 <= coins[2] n50 coins[2] coins 2 n50++ n50++ n50 {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                } {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                } if (n50 * 50 > x) {
                        continue;
                    } n50 * 50 > x n50 * 50 n50 50 x {
                        continue;
                    } continue; int sum = (n500 * 500) + (n100 * 100) + (n50 * 50); sum (n500 * 500) + (n100 * 100) + (n50 * 50) (n500 * 500) + (n100 * 100) + (n50 * 50) (n500 * 500) n500 500 (n100 * 100) n100 100 (n50 * 50) n50 50 if (sum == x) {
                        cnt++;
                    } sum == x sum x {
                        cnt++;
                    } cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {
    private static int ROW = 3;
    private static int[] VALUES = {500, 100, 50};
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] coins = new int[ROW];
        for (int i = 0; i < ROW; i++) {
            coins[i] = sc.nextInt();
        }
        int x = sc.nextInt();
        int cnt = 0;

        for (int n500 = 0; n500 <= coins[0]; n500++) {
            if (n500 * 500 > x) {
                continue;
            }
            for (int n100 = 0; n100 <= coins[1]; n100++) {
                if (n100 * 100 > x) {
                    continue;
                }
                for (int n50 = 0; n50 <= coins[2]; n50++) {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                }
            }
        }
        System.out.println(cnt);
    }
} public class Main {
    private static int ROW = 3;
    private static int[] VALUES = {500, 100, 50};
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] coins = new int[ROW];
        for (int i = 0; i < ROW; i++) {
            coins[i] = sc.nextInt();
        }
        int x = sc.nextInt();
        int cnt = 0;

        for (int n500 = 0; n500 <= coins[0]; n500++) {
            if (n500 * 500 > x) {
                continue;
            }
            for (int n100 = 0; n100 <= coins[1]; n100++) {
                if (n100 * 100 > x) {
                    continue;
                }
                for (int n50 = 0; n50 <= coins[2]; n50++) {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                }
            }
        }
        System.out.println(cnt);
    }
} Main
import java.util.Scanner;

public class Main {
    private static int ROW = 3;
    private static int[] VALUES = {500, 100, 50};
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] coins = new int[ROW];
        for (int i = 0; i < ROW; i++) {
            coins[i] = sc.nextInt();
        }
        int x = sc.nextInt();
        int cnt = 0;

        for (int n500 = 0; n500 <= coins[0]; n500++) {
            if (n500 * 500 > x) {
                continue;
            }
            for (int n100 = 0; n100 <= coins[1]; n100++) {
                if (n100 * 100 > x) {
                    continue;
                }
                for (int n50 = 0; n50 <= coins[2]; n50++) {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                }
            }
        }
        System.out.println(cnt);
    }
}
