#include <bits/stdc++.h>
using namespace std;
int n, m, res, sum, t1, t2, tot, vis[160005], mat[160005], hd[160005],
    to[160005], nxt[160005];
char ch[205][205];
vector<int> p[205][205], q[205][205];
int read() {
  int x = 0, fl = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') fl = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * fl;
}
void add(int x, int y) {
  tot++;
  to[tot] = y;
  nxt[tot] = hd[x];
  hd[x] = tot;
  return;
}
int dfs(int x) {
  for (int i = hd[x]; i; i = nxt[i]) {
    int y = to[i];
    ;
    if (vis[y]) continue;
    vis[y] = 1;
    if (!mat[y] || dfs(mat[y])) {
      mat[y] = x;
      return 1;
    }
  }
  return 0;
}
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; i++) {
    scanf("%s", ch[i] + 1);
    for (int j = 1; j <= m; j++) res += (ch[i][j] == '#');
  }
  for (int i = 1; i <= n - 1; i++)
    for (int j = 1; j <= m; j++)
      if (ch[i][j] == '#' && ch[i + 1][j] == '#')
        p[i][j].push_back(++t1), p[i + 1][j].push_back(t1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m - 1; j++)
      if (ch[i][j] == '#' && ch[i][j + 1] == '#')
        q[i][j].push_back(++t2), q[i][j + 1].push_back(t2);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      for (int x = 0; x < (int)p[i][j].size(); x++)
        for (int y = 0; y < (int)q[i][j].size(); y++)
          add(p[i][j][x], q[i][j][y] + t1);
  for (int i = 1; i <= t1; i++) {
    sum += dfs(i);
    memset(vis, 0, sizeof(vis));
  }
  printf("%d\n", res - (t1 + t2 - sum));
  return 0;
}
