#include <iostream>
#include <cstdio>
using namespace std;

int h, w, d[105][105];
char a[105][105];
int main() {
	int i, j;
	cin >> h >> w;
	for(i=0; i<h; i++) scanf("%s", &a[i]);
	d[0][0] = (a[0][0]=='#');
	for(i=0; i<h; i++) for(j=0; j<w; j++) {
		if(i+j==0) continue;
		d[i][j] = 1e9;
		if(i>0) d[i][j] = min(d[i][j], d[i-1][j] + (a[i-1][j]=='.' && a[i][j]=='#'));
		if(j>0) d[i][j] = min(d[i][j], d[i][j-1] + (a[i][j-1]=='.' && a[i][j]=='#'));
	}
	cout << d[h-1][w-1];
	return 0;
}