#include <bits/stdc++.h>
using namespace std;
int dp[401][201][201];
int A[201][201];
bool same(int ay, int ax, int by, int bx) { return ay == by && ax == bx; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int H, W;
  while (cin >> H >> W) {
    for (int(y) = (0); (y) < (int)(H); ++(y))
      for (int(x) = (0); (x) < (int)(W); ++(x)) cin >> A[y][x];
    memset((dp), (-1), sizeof(dp));
    dp[0][0][0] = A[0][0];
    for (int(s) = (0); (s) < (int)(H + W - 2); ++(s)) {
      for (int(ay) = (0); (ay) < (int)(H); ++(ay)) {
        int ax = s - ay;
        if (ax < 0 || ax >= W) continue;
        for (int(by) = (0); (by) < (int)(H); ++(by)) {
          int bx = s - by;
          if (bx < 0 || bx >= W) continue;
          int z = dp[s][ay][by];
          if (z == -1) continue;
          if (ay < H - 1 && by < H - 1) {
            int nay = ay + 1;
            int nby = by + 1;
            int w = z + A[nay][ax] + A[nby][bx];
            if (same(nay, ax, nby, bx)) {
              w -= A[nay][ax];
            }
            (dp[s + 1][nay][nby]) = max((dp[s + 1][nay][nby]), (w));
          }
          if (ay < H - 1 && bx < W - 1) {
            int nay = ay + 1;
            int nbx = bx + 1;
            int w = z + A[nay][ax] + A[by][nbx];
            if (same(nay, ax, by, nbx)) {
              w -= A[nay][ax];
            }
            (dp[s + 1][nay][by]) = max((dp[s + 1][nay][by]), (w));
          }
          if (ax < W - 1 && by < H - 1) {
            int nax = ax + 1;
            int nby = by + 1;
            int w = z + A[ay][nax] + A[nby][bx];
            if (same(ay, nax, nby, bx)) {
              w -= A[ay][nax];
            }
            (dp[s + 1][ay][nby]) = max((dp[s + 1][ay][nby]), (w));
          }
          if (ax < W - 1 && bx < W - 1) {
            int nax = ax + 1;
            int nbx = bx + 1;
            int w = z + A[ay][nax] + A[by][nbx];
            if (same(ay, nax, by, nbx)) {
              w -= A[ay][nax];
            }
            (dp[s + 1][ay][by]) = max((dp[s + 1][ay][by]), (w));
          }
        }
      }
    }
    cout << dp[H + W - 2][H - 1][W - 1] << endl;
  }
}
