#include <bits/stdc++.h>
using namespace std;
int n, a, b, c;
int main() {
  cin >> n >> c >> b >> a;
  n *= 2;
  long long sum = 0;
  for (int i = 0; i <= a; i++) {
    for (int j = 0; j <= b; j++) {
      if ((n - ((i * 4) + (j * 2)) <= c) && (n - ((i * 4) + (j * 2)) >= 0)) {
        sum++;
      }
    }
  }
  cout << sum << endl;
  return 0;
}
