#include <iostream>
#include <algorithm>
using namespace std;
int H, W, a[203][203], lt[403], rt[403], dp[403][203][203];
int main() {
cin >> H >> W;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) cin >> a[i][j];
}
for (int i = 0; i < H; i++) lt[i] = 0;
for (int i = 0; i < W; i++) rt[i] = i + 1;
for (int i = H; i < H + W - 1; i++) lt[i] = i - H + 1;
for (int i = W; i < H + W - 1; i++) rt[i] = W;
dp[0][0][0] = a[0][0];
for (int i = 1; i < H + W - 1; i++) {
for (int j = lt[i]; j < rt[i]; j++) {
for (int k = lt[i]; k < rt[i]; k++) {
int p = (j != k ? a[i - j][j] + a[i - k][k] : a[i - j][j]);
for (int dj = -1; dj <= 0; dj++) {
for (int dk = -1; dk <= 0; dk++) {
if (j + dj >= 0 && k + dk >= 0) dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j + dj][k + dk] + p);
}
}
}
}
}
cout << dp[H + W - 2][W - 1][W - 1] << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgSCwgVywgYVsyMDNdWzIwM10sIGx0WzQwM10sIHJ0WzQwM10sIGRwWzQwM11bMjAzXVsyMDNdOwppbnQgbWFpbigpIHsKCWNpbiA+PiBIID4+IFc7Cglmb3IgKGludCBpID0gMDsgaSA8IEg7IGkrKykgewoJCWZvciAoaW50IGogPSAwOyBqIDwgVzsgaisrKSBjaW4gPj4gYVtpXVtqXTsKCX0KCWZvciAoaW50IGkgPSAwOyBpIDwgSDsgaSsrKSBsdFtpXSA9IDA7Cglmb3IgKGludCBpID0gMDsgaSA8IFc7IGkrKykgcnRbaV0gPSBpICsgMTsKCWZvciAoaW50IGkgPSBIOyBpIDwgSCArIFcgLSAxOyBpKyspIGx0W2ldID0gaSAtIEggKyAxOwoJZm9yIChpbnQgaSA9IFc7IGkgPCBIICsgVyAtIDE7IGkrKykgcnRbaV0gP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