#include int a, b, c, d; int main(void) { int value = 0; int pattern = 1; int i; scanf("%d %d %d %d", &a, &b, &c, &d); value = (b - a + 1) + (d - c + 1); for(i = 1;i <= value;i++) { pattern = pattern * i; } printf("%d\n", pattern); return (0); }