import java.util.*;
import java.io.*;
import java.math.BigInteger;

public class garnett_dk_stupid {
	BufferedReader br;
	PrintWriter out;
	StringTokenizer stok;

	String nextToken() throws IOException {
		while (stok == null || !stok.hasMoreTokens()) {
			String s = br.readLine();
			if (s == null) {
				return null;
			}
			stok = new StringTokenizer(s);
		}
		return stok.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	char nextChar() throws IOException {
		return (char) (br.read());
	}

	String nextLine() throws IOException {
		return br.readLine();
	}

	static long MOD = (long) 1e9 + 7;

	void solve() throws IOException {
		int n = nextInt();
		int m = nextInt();
		int[][] a = new int[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				a[i][j] = nextInt();
			}
		}
		int ans = 0;
		for (int i1 = 0; i1 < n; i1++) {
			for (int j1 = 0; j1 < m; j1++) {
				for (int i2 = i1; i2 < n; i2++) {
					for (int j2 = j1; j2 < m; j2++) {
						int kol = 0;
						for (int i3 = i1; i3 <= i2; i3++) {
							for (int j3 = j1; j3 <= j2; j3++) {
								if (a[i3][j3] == 1) kol++;
							}
						}
						if (kol == 1) ans = Math.max(ans, (i2 - i1 + 1) * (j2 - j1 + 1));
					}
				}
			}
		}
		out.println(ans);
	}

	void run() throws IOException {
		br = new BufferedReader(new FileReader("garnett.in"));
		out = new PrintWriter("garnett.out");
		solve();
		br.close();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		new garnett_dk_stupid().run();
	}
}
