#include <bits/stdc++.h>
using namespace std;
const int N = 210, dir[4][2] = {{0, 0}, {0, -1}, {1, 0}, {1, -1}};
int n, m, fa[N * N], vis[N * N], num1[N][N], num2[N][N], now = 0, tot1, tot2,
                                                         grid[N][N];
vector<int> g[N * N];
bool find(int x) {
  for (int i = 0; i < g[x].size(); i++) {
    int y = g[x][i];
    if (vis[y] != now) {
      vis[y] = now;
      if (fa[y] == 0 || find(fa[y])) {
        fa[y] = x;
        return 1;
      }
    }
  }
  return 0;
}
int main() {
  cin >> n >> m;
  string st;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    cin >> st;
    for (int j = 1; j <= m; j++) {
      grid[i][j] = (st[j - 1] == '#');
      if (grid[i][j]) {
        ans++;
        if (grid[i][j - 1]) num1[i][j] = ++tot1;
        if (grid[i - 1][j]) num2[i][j] = ++tot2;
      }
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (num1[i][j]) {
        for (int k = 0; k < 4; k++) {
          int x = i + dir[k][0], y = j + dir[k][1];
          if (num2[x][y]) g[num1[i][j]].push_back(num2[x][y]);
        }
      }
  int maxMatch = 0;
  for (int i = 1; i <= tot1; i++) {
    now++;
    maxMatch += find(i);
  }
  ans -= tot1 + tot2 - maxMatch;
  cout << ans << endl;
}
