#include <iostream>
#include <vector>
#include <string>

using namespace std;

int dp[105][105];

int main() {
	int h, w; cin >> h >> w;
	vector<string> s(h);
	for (auto& e : s) cin >> e;
	for (int i = 0; i <= h; ++i)
		for (int j = 0; j <= w; ++j)
			dp[i][j] = 1e9;
	dp[0][0] = (s[0][0] == '#' ? 1 : 0);
	for (int i = 0; i < h; ++i) {
		for (int j = 0; j < w; ++j) {
			if (i + 1 < h) dp[i + 1][j] = min(dp[i][j] + (s[i][j] == '.' && s[i + 1][j] == '#' ? 1 : 0), dp[i + 1][j]);
			if (j + 1 < w) dp[i][j + 1] = min(dp[i][j] + (s[i][j] == '.' && s[i][j + 1] == '#' ? 1 : 0), dp[i][j + 1]);
		}
	}
	cout << dp[h - 1][w - 1] << endl;

	return 0;
}