#include int main() { int a, b, c, d; scanf("%d %d %d %d", &a, &b, &c, &d); int ans = (b - a + 1) * (d - c + 1); if (c > a)a = c; if (d < b)b = d; if (a <= b) ans -= b - a + 1; printf("%d\n", ans); return 0; }