#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
using namespace std;
const int inf=1e9+10;
int n,m,dp[110][110];
char s[110][110];
int main()
{
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;i++)
	 for (int j=1;j<=m;j++) dp[i][j]=inf;
	for (int i=1;i<=n;i++) scanf("%s",s[i]+1);
	if (s[1][1]=='#') dp[1][1]=1;else dp[1][1]=0;
	for (int i=1;i<=n;i++)
	 for (int j=1;j<=m;j++)
	 {
	 	if (i==1 && j==1) continue;
	 	if (i-1>=1) dp[i][j]=min(dp[i][j],dp[i-1][j]+(s[i-1][j]=='.' && s[i][j]=='#'));
	 	if (j-1>=1) dp[i][j]=min(dp[i][j],dp[i][j-1]+(s[i][j-1]=='.' && s[i][j]=='#'));
	 }
	printf("%d\n",dp[n][m]);
return 0;
}