#include <bits/stdc++.h>
using namespace std;
int H, W;
int A[200][200];
long long dp[400][200][200];
int main() {
  cin >> H >> W;
  for (int y = 0; y < H; y++)
    for (int x = 0; x < W; x++) cin >> A[y][x];
  dp[0][0][0] = A[0][0];
  int N = max(H, W);
  for (int i = 0; i < N * 2; i++)
    for (int j = 0; j < N; j++)
      for (int k = j; k < N; k++) {
        int ax = j;
        int ay = i - j;
        int bx = k;
        int by = i - k;
        if (ay < 0) continue;
        if (by < 0) continue;
        if (ax < N - 1 && bx < N - 1)
          dp[i + 1][j + 1][k + 1] =
              max(dp[i + 1][j + 1][k + 1],
                  dp[i][j][k] + ((ax + 1 == bx + 1 && ay == by)
                                     ? A[ay][ax + 1]
                                     : A[ay][ax + 1] + A[by][bx + 1]));
        if (ax < N - 1 && by < N - 1)
          dp[i + 1][j + 1][k] =
              max(dp[i + 1][j + 1][k],
                  dp[i][j][k] + ((ax + 1 == bx && ay == by + 1)
                                     ? A[ay][ax + 1]
                                     : A[ay][ax + 1] + A[by + 1][bx]));
        if (ay < N - 1 && bx < N - 1)
          dp[i + 1][j][k + 1] =
              max(dp[i + 1][j][k + 1],
                  dp[i][j][k] + ((ax == bx + 1 && ay + 1 == by)
                                     ? A[ay + 1][ax]
                                     : A[ay + 1][ax] + A[by][bx + 1]));
        if (ay < N - 1 && by < N - 1)
          dp[i + 1][j][k] =
              max(dp[i + 1][j][k],
                  dp[i][j][k] + ((ax == bx && ay + 1 == by + 1)
                                     ? A[ay + 1][ax]
                                     : A[ay + 1][ax] + A[by + 1][bx]));
        if (ax == bx && ay == by) {
          if (ax == W - 1 && ay == H - 1) {
            cout << dp[i][j][k] << endl;
            return 0;
          }
        }
      }
}
