#include using namespace std; int main() { int a[101][101],n,m; cin>>n>>m; char aux; for(int i=1;i<=n;i++) for(int j=1;j<=m;j++) { cin>>aux; if(aux=='.') a[i][j]=0; else a[i][j]=1; } int x=1; int y=1; int step=0; while(y!=m) { if(a[x][y+1]==0) { y++; step++; } if(a[x+1][y]==0) { x++; step++; } } cout<