#include using namespace std; struct coada { int x,y;}; int a[102][102],b[102][102]; coada c[10002]; int main() { char ch; int n,m,i,j,p,u,x,y; cin>>n>>m; for(i=1;i<=n;i++)for(j=1;j<=m;j++) { cin>>ch; if(ch=='.')a[i][j]=1; else a[i][j]=0;} //LEE: p=u=1; c[p].x=1; c[p].y=1; b[1][1]=1; int maxim=0; while(p<=u){ x=c[p].x; y=c[p].y; if(a[x+1][y]==1){b[x+1][y]=b[x][y]+1; u++; c[u].x=x+1; c[u].y=y; if(b[x+1][y]>maxim)maxim=b[x+1][y];} if(a[x][y+1]==1){b[x][y+1]=b[x][y]+1; u++; c[u].x=x; c[u].y=y+1; if(b[x][y+1]>maxim)maxim=b[x][y+1];} p++; } cout<