#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(int i=0;i> H >> W; REP(i,H+1) REP(j,W+1) a[i][j]='#'; for(i=1;i<=H;i++){ for(j=1;j<=W;j++){ cin >> a[i][j]; } } dfs(1,1,0); cout << ans << endl; return 0; }