#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int H,W;
  cin >> H >> W;
  vector<string> s(H);
  for(int i=0;i<H;++i) cin >> s[i];
  int dp[110][110];
  dp[0][0]=0;
  if(s[0][0]=='#') dp[0][0]++;
  for(int i=0;i<H;++i){
    for(int j=0;j<W;++j){
      if(i > 0 || j > 0){
        dp[i][j] = 1e9;
        if(i>0) dp[i][j] = min(dp[i][j],dp[i-1][j] + ((s[i][j]=='#') && (s[i-1][j]=='.')));
        if(j>0) dp[i][j] = min(dp[i][j],dp[i][j-1] + ((s[i][j]=='#') && (s[i][j-1]=='.')));
      }
    }
  }
  
  cout << dp[H-1][W-1] << endl;
}