module app;

import std.stdio;
import std.algorithm;
import std.range;
import std.array;
import std.string;
import std.conv;

void main(string[] args) {
    auto five_hund = readln.chop.to!int;
    auto one_hund = readln.chop.to!int;
    auto fifty = readln.chop.to!int;
    immutable auto target_yen = readln.chop.to!int;
    int answer;
    foreach(fh; iota(0, five_hund+1)) {
        foreach(oh; iota(0, one_hund+1)) {
            foreach(f; iota(0, fifty+1)) {
                if(fh*500 + oh*100 + f*50 == target_yen){
                    answer++;
                }
            }
        }
    }
    writeln(answer);
}