/*
TASK: apple
LANG: C++
*/

#include <stdio.h>

#define max(a,b) ((a)>(b) ? (a):(b))

const int MAX_N = 70+3;

const int dx[] = {1,0};
const int dy[] = {0,1};

int n, m;
int A[MAX_N][MAX_N];
int dp[MAX_N][MAX_N][MAX_N];
int ans;

void input ()
{
	int i, j;

	scanf ("%d%d", &n, &m);

	for (i=1; i<=n; i++)
		for (j=1; j<=m; j++)
			scanf ("%d", &A[i][j]);
}

void solve ()
{
	int moves;
	int x1, y1, x2, y2;
	int newx1, newy1, newx2, newy2;
	int k1, k2;
	int newdp;

	dp[0][1][1] = A[1][1];

	for (moves=0; moves<=m+n-2; moves++) {
		for (x1=1; x1<=moves+1; x1++) {
			for (x2=1; x2<=moves+1; x2++) {
				y1 = moves-x1+2;
				y2 = moves-x2+2;

				for (k1=0; k1<2; k1++) {
					newx1 = x1 + dx[k1];
					newy1 = y1 + dy[k1];

					if (newx1>n || newy1>m) continue;

					for (k2=0; k2<2; k2++) {
						newx2 = x2 + dx[k2];
						newy2 = y2 + dy[k2];

						if (newx2>n || newy2>m) continue;
					
						newdp = dp[moves][x1][x2] + A[newx1][newy1] + A[newx2][newy2];
						if (newx1==newx2 && newy1==newy2) newdp -= A[newx2][newy2];

						dp[moves+1][newx1][newx2] = max(dp[moves+1][newx1][newx2], newdp);
					}
				}

				printf ("dp[%d][%d][%d] = %d\n", moves, x1, x2, dp[moves][x1][x2]);
			}
		}
	}
}

int main ()
{
//	freopen ("apple.in", "r", stdin);

	input ();
	solve ();

	printf ("%d\n", dp[n+m-2][n][n]);

	return 0;
}