#include <bits/stdc++.h>
using namespace std;
int dp[201][201][500];
int grid[201][201];
int main() {
  int h, w;
  cin >> h >> w;
  for (long long i = 0; i < h; ++i) {
    for (long long q = 0; q < w; ++q) {
      cin >> grid[i][q];
    }
  }
  dp[0][0][0] = 1;
  for (int i = 0; i < h + w - 2; ++i) {
    for (int q = 0; q <= i; ++q) {
      for (int j = 0; j <= i; ++j) {
        int first_x = q;
        int first_y = i - q;
        int second_x = j;
        int second_y = i - j;
        for (long long t = 0; t < 2; ++t) {
          for (long long p = 0; p < 2; ++p) {
            int next_fx = first_x + t;
            int next_fy = first_y + 1 - t;
            int next_sx = second_x + p;
            int next_sy = second_y + 1 - p;
            if (next_fx >= h || next_sx >= h | next_fy >= w | next_sy >= w) {
              continue;
            }
            int winning = dp[q][j][i] + grid[next_fx][next_fy];
            if (next_fx != next_sx || next_fy != next_sy) {
              winning += grid[next_sx][next_sy];
            }
            dp[next_fx][next_sx][next_fx + next_fy] =
                max(dp[next_fx][next_sx][next_fx + next_fy], winning);
          }
        }
      }
    }
  }
  cout << dp[h - 1][h - 1][h + w - 2] << endl;
}
