10 20 10 5
 20 1 2 3
 7 2 2 2
 25 10 5 10
 999 999 899 299
 10000 5000 0 5000
 2 2 2 2
 1 0 2 0
 3 3 2 1
 1 1 0 0
 1 0 0 1
 20 10 20 30
 505 142 321 12
 101 10 10 50
 10 19 15 100
 10000 5000 5000 0
 1234 645 876 1000
 3 10 10 10
 1 0 1 0
 7 3 0 5
 101 10 0 50
 1 0 0 0
 10 0 8 10
 1 2 0 0
 5 2 1 1
 8765 2432 2789 4993
 8987 4000 2534 4534
 10000 5000 5000 5000
 10000 5000 2500 2500
 10000 0 5000 5000
 10000 4999 2500 2500
 5 5000 5000 5000
 10000 4534 2345 4231
 5643 1524 1423 2111
 7777 4444 3333 2222
 2500 5000 5000 5000
 10000 2500 2500 2500
 5000 5000 5000 5000

36
 0
 1
 12
 145000
 1251
 3
 1
 3
 0
 0
 57
 0
 33
 35
 0
 141636
 6
 1
 1
 3
 0
 5
 1
 0
 1697715
 2536267
 6253751
 1
 2501
 0
 12
 2069003
 146687
 1236544
 1565001
 0
 4691251

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ff(i,s,e) for(int i=(s);i<(int)(e);i++)
#define fr(i,s,e) for(int i=(e);i-->(int)(s);)
#define FF(i,s,e) for(int i=(s);i<=(int)(e);i++)
#define Fr(i,s,e) for(int i=(e);i>=(int)(s);i--)

#define gcd(a,b) __gcd(a,b)
#define all(a) a.begin(),a.end()
#define ln putchar('\n')
#define sp putchar(' ')
using namespace __gnu_pbds;
using namespace std;

void init(int i){
#ifndef ONLINE_JUDGE
  char str[100];sprintf(str,"xx/%d.txt",i);freopen(str,"r",stdin);
#endif
}

typedef tree<int,int,less<int>,rb_tree_tag,tree_order_statistics_node_update>imap;

typedef long long ll;

typedef pair<int,int> pii;
typedef map<int,int> mii;
typedef map<ll,ll> mll;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<pii> vpii;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<double> vd;

template<class T>inline int pr(const T&v);
template<class T, class...Args> inline int pr(const T&a,const Args (&... args));

inline int scan(int&i){return scanf("%d",&i);}
inline int scan(ll&i){return scanf("%" PRId64,&i);}
inline int scan(double&i){return scanf("%lf",&i);}
inline int scan(char&i){int c;while((c=getchar())!=EOF&&c<=' ');i=c;return c!=EOF;}
inline int scan(string&i){i.clear();int c;while((c=getchar())!=EOF&&c<=' ');while(c>' ')i+=c,c=getchar();return i.size();}
inline int scanln(string&i){i.clear();int c;while((c=getchar())!=EOF&&c<' ');while(c>=' ')i+=c,c=getchar();return i.size();}
template<class T> inline int scan(T&a){a.sc();}
template<class T, class U> inline int scan(pair<T,U>&a){scan(a.first),scan(a.second);}

inline int pr(const int& i){printf("%d",i);}
inline int pr(const long& i){printf("%ld",i);}
inline int pr(const unsigned int& i){printf("%x",i);}
inline int pr(const bool i){printf("%d",i);}
inline int pr(const ll&i){printf("%" PRId64,i);}
inline int pr(const double&i){printf("%.12f",i);}
inline int pr(const float&i){printf("%.4f",i);}
inline int pr(const char&i){putchar(i);}
inline int pr(const char*i){printf("%s",i);}
inline int pr(const string&i){for(char c:i)pr(c);}

template<class T>inline int scan(vector<T>&v){for(T&i:v)scan(i);}
template<class T>inline int pr(const vector<T>&v){if(v.empty())return 0;pr(v[0]);ff(i,1,v.size())pr(' '),pr(v[i]);}
template<class T,class U>inline int pr(const pair<T,U>&p){pr(p.first,p.second);}
template<class T>inline int prlns(const vector<T>&v){ff(i,0,v.size())pr(v[i]),pr('\n');}
template<class T, class...Args> inline int scan(T&a,Args (&... args)){return scan(a),scan(args...);}
template<class T, class...Args> inline int pr(const T&a,const Args (&... args)){pr(a),pr(' '),pr(args...);}
template<class T> inline int prln(const T&a){pr(a),ln;}
template<class T, class...Args> inline int prln(const T&a,const Args (&... args)){pr(a),sp,prln(args...);}
template<class...Args> inline int rpr(const Args (&... args)){
#ifndef ONLINE_JUDGE
  pr(args...),ln;fflush(stdout);
#endif
}
inline int gi(){int x;scan(x);return x;}

template<class T>inline int pr(const T&v){v.print();}

template<class T, class U> inline void smax(T&a,const U&b){if(a<b)a=b;}
template<class T, class U> inline void smin(T&a,const U&b){if(b<a)a=b;}

template<class T> T& operator +=(vector<T>&v,const T&a){v.push_back(a);return v.back();}

const int inf = ~((1<<31));
const ll LargeMod = 4611686018427388039;
const ll MOD = 1E9+7;
const ll linf = 1E17;
typedef unsigned int uint;


struct tea{
  int a, b, val;
  operator <(tea o) const{
    return val > o.val;
  }
};

struct problem{
  int solve() {
    
  }
  
  int init(){
    
  }
  
  int get_input(){
    int n, a, b, c;
    scan(n, a, b, c);
    n *= 2;
    int ans = 0;
    ff(i,0,c){
      ff(j,0,b){
        ans += (n - 4*i - 2*j) > 0 && (n - 4*i - 2*j) <= a;
      }
    }
    pr(ans);
  }
};


main(){
  init(2);
  problem a;
  a.get_input();
  a.init();
  a.solve();
}