#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxm = 2e2 + 10;
const int N = maxm * maxm * 2;
const int inf = 0x3f3f3f3f;
template <typename T>
inline bool read(T &x) {
  x = 0;
  char c = getchar();
  bool n = 0;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-')
      n ^= 1;
    else if (c == EOF)
      return 0;
  for (; '0' <= c && c <= '9'; c = getchar()) x = x * 10 + (c ^ 48);
  n ? (x = -x) : 0;
  return c != EOF;
}
template <typename A, typename... B>
inline bool read(A &x, B &...y) {
  return read(x) && read(y...);
}
int pt[maxm][maxm][2], a[maxm][maxm];
char ss[maxm];
int s, t;
int now[N], dep[N], head[N];
struct Edge {
  int v, w, nxt;
} ed[N * 16];
int ecnt;
void addedge(int u, int v, int w) {
  ed[ecnt] = {v, w, head[u]};
  head[u] = ecnt++;
  ed[ecnt] = {u, 0, head[v]};
  head[v] = ecnt++;
}
int bfs() {
  queue<int> q;
  while (!q.empty()) q.pop();
  for (int i = s; i <= t; i++) {
    dep[i] = -1;
    now[i] = -1;
  }
  dep[s] = 0;
  q.push(s);
  now[s] = head[s];
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i = head[u]; i != -1; i = ed[i].nxt) {
      int v = ed[i].v;
      if (ed[i].w > 0 && dep[v] == -1) {
        dep[v] = dep[u] + 1;
        now[v] = head[v];
        q.push(v);
      }
    }
  }
  return dep[t] != -1;
}
int dfs(int u, int mi) {
  if (mi == 0 || u == t) return mi;
  int temp, sum = 0;
  for (int i = now[u]; i != -1 && mi; i = ed[i].nxt) {
    now[u] = i;
    int v = ed[i].v;
    if (ed[i].w > 0 && dep[v] == dep[u] + 1) {
      temp = dfs(v, min(mi, ed[i].w));
      ed[i].w -= temp;
      ed[i ^ 1].w += temp;
      sum += temp;
      mi -= temp;
      if (!mi) break;
    }
  }
  return sum;
}
int dinic() {
  int ans = 0;
  while (bfs()) ans += dfs(s, inf);
  return ans;
}
int main() {
  memset(head, -1, sizeof(head));
  int n, m;
  read(n, m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", ss + 1);
    for (int j = 1; j <= m; j++)
      if (ss[j] == '#') a[i][j] = 1;
  }
  int zz = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (!a[i][j]) continue;
      if (a[i][j + 1]) pt[i][j][0] = ++zz;
      if (a[i + 1][j]) pt[i][j][1] = ++zz;
    }
  }
  int num = 0, ans = 0;
  s = 0, t = zz + 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (!a[i][j]) continue;
      if (pt[i][j][1] && pt[i][j][0]) addedge(pt[i][j][1], pt[i][j][0], inf);
      if (pt[i][j][1] && pt[i + 1][j][0])
        addedge(pt[i][j][1], pt[i + 1][j][0], inf);
      if (pt[i][j][1] && pt[i][j - 1][0])
        addedge(pt[i][j][1], pt[i][j - 1][0], inf);
      if (pt[i][j][1] && pt[i + 1][j - 1][0])
        addedge(pt[i][j][1], pt[i + 1][j - 1][0], inf);
      if (pt[i][j][1]) {
        addedge(s, pt[i][j][1], 1), num++;
      }
      if (pt[i][j][0]) {
        addedge(pt[i][j][0], t, 1), num++;
      }
      ans++;
    }
  }
  ans = ans - (num - dinic());
  printf("%d\n", ans);
  return 0;
}
