public static void main(String[] args) throws IOException {
		FileReader reader = null;
		StringBuilder numString = new StringBuilder();

		try {
			reader = new FileReader("grid.txt");

			int c = reader.read();
			int row = 0, col = 0;

			while (c != -1) {
				if ((char) c != ' ' && (char) c != '\n') {
					numString.append((char) c);
				} else {
					int n = Integer.parseInt(numString.toString());

					numGrid[row][col] = n;
					col++;

					if (col >= 20) {
						col = 0;
						row++;
					}

					numString.delete(0, 2);
				}
				c = reader.read();
			}
		} finally {
			if (reader != null) reader.close();
		}

		System.out.println(calcMaxProduct());
	}