//code by flutterfly
#include <iostream>
// Function declaration
void Max_Area(int N, int M, int X, int Y);
// Driver Function
int main()
{
// Inputs
int N = 3, M = 2, X = 1, Y = 1;
// Function call
Max_Area(N, M, X, Y);
return 0;
}
void Max_Area(int N, int M, int X, int Y)
{
// Total area of the matrix
int total = N * M;
// a,b,c,d are no.of blue cells according
// to the position of the yellow cell
int A, B, C, D, C1, C2, C3;
A = X * M; // The above grids are blue
B = (N - X + 1) * M; // The below grids are blue
C = Y * N; // The left grids are blue
D = (M - Y + 1) * N; // The right grids are blue
C1 = std::min(A, B);
C2 = std::min(C, D);
C3 = std::min(C1, C2);
// c3 has minimum of a,b,c,d
// total-c3 gives you the number
// of yellow grids
std::cout << total - C3 << std::endl;
}