#include <bits/stdc++.h>
int main() {
  int n, a, b, c, cnt = 0;
  scanf("%d%d%d%d", &n, &a, &b, &c);
  n *= 2;
  for (int i = 0; i <= a; i++) {
    for (int j = 0; j <= b; j++) {
      int k = (n - i - 2 * j);
      if (k % 4) continue;
      if (k / 4 > c || k / 4 < 0) continue;
      cnt++;
    }
  }
  printf("%d", cnt);
  return 0;
}
