// UNNECESSARY
// #include <chrono>//std::chrono::/system_clock/steady_clock/high_resolution_clock/duration
// #include <cstdio>//printf/scanf/fopen/fclose/fprintf/fscanf/snprintf/putc/puts/getc/gets
// #include <fstream>//ifstream/ofstream

// DATA STRUCTURES
#include <array>
#include <bitset>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <valarray>
#include <vector>

// MISCELLANEOUS
#include <algorithm>//min/max/sort(rand-access it)/merge
#include <cassert>
#include <climits>//INT_MAX/INT_MIN/ULLONG_MAX
#include <cmath>//fmin/fmax/fabs/sin(h)/cos(h)/tan(h)/exp/log/pow/sqrt/cbrt/ceil/floor/round/trunc
#include <cstdlib>//abs/atof/atoi/atol/atoll/strtod/strtof/..., srand/rand, calloc/malloc, exit, qsort
#include <iomanip>//setfill/setw/setprecision/fixed/scientific
#include <iostream>//cin/cout/wcin/wcout/left/right/internal/dec/hex/oct/fixed/scientific
#include <iterator>
#include <limits>//numeric_limits<type>::max/min/lowest/epsilon/infinity/quiet_NaN/signaling_NaN
#include <new>
#include <string>//stoi/stol/stoul/stoll/stoull/stof/stod/stold/to_string/getline
#include <utility>//pair

#ifndef REP
#define REP(i,n) for (int i = 0; i < n; ++i)
#endif

#ifndef REPST
#define REPST(i,n) for (size_t i = 0; i < n; ++i)
#endif

#ifndef READ
#define READ(x) std::cin >> x
#endif

typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<int, int> pii;
typedef std::pair<ll, int> plli;
typedef std::pair<ull, int> puli;
typedef std::pair<double, int> pdi;
typedef std::pair<ll, ll> pllll;
typedef std::pair<ull, ull> pulul;
typedef std::pair<double, double> pdd;
typedef std::tuple<int, int, int> ti3;
typedef std::tuple<int, int, int, int> ti4;

const bool debug = false;

// --------------------------------------------------------------------------------------

using namespace std;



int main(void)
{
    int a, b, c, x;
    cin >> c >> b >> a >> x;
    std::set<ti3> s;
    std::queue<ti3> q;
    ti3 initial;
    {
        div_t dd{};
        dd = div(x, 500);
        int ci = dd.quot;
        if (ci > c) {
            ci = c;
            dd.rem += (dd.quot - c) * 500;
        }
        dd = div(dd.rem, 100);
        int bi = dd.quot;
        if (bi > b) {
            bi = b;
            dd.rem += (dd.quot - b) * 100;
        }
        dd = div(dd.rem, 50);
        int ai = dd.quot;
        if (ai > a) {
            ai = a;
            dd.rem += (dd.quot - a) * 50;
        }
        if (dd.rem) {
            cout << 0 << endl;
            return 0;
        }
        initial = make_tuple(ai, bi, ci);
    }
    s.insert(initial);
    q.push(initial);
    while (!q.empty()) {
        int aa, bb, cc;
        tie(aa, bb, cc) = q.front();
        if (cc >= 1) {
            if (bb+5 <= b) {
                ti3 next = make_tuple(aa, bb+5, cc-1);
                if (s.find(next) == s.end()) {
                    s.insert(next);
                    q.push(next);
                }
            }
            if (aa+10 <= a) {
                ti3 next = make_tuple(aa+10, bb, cc-1);
                if (s.find(next) == s.end()) {
                    s.insert(next);
                    q.push(next);
                }
            }
        }
        if (bb >= 1 && aa+2 <= a) {
            ti3 next = make_tuple(aa+2, bb-1, cc);
            if (s.find(next) == s.end()) {
                s.insert(next);
                q.push(next);
            }
        }
        q.pop();
    }
    cout << s.size() << endl;
    return 0;
}


Measured memory_bytes: 256