#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  register long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  }
  return (f == 1) ? x : -x;
}
inline void file() {
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
}
char cac[210][210];
struct edge {
  int to, f, nxt;
} g[2010101];
int _, n, m, s, t, tot, head[202020], dep[202020], pre[202020];
inline void maded(int from, int to, int f) {
  g[++tot].to = to;
  g[tot].nxt = head[from];
  head[from] = tot;
  g[tot].f = f;
}
inline void made(int from, int to, int f) {
  maded(from, to, f);
  maded(to, from, 0);
}
inline int dfs(int u, long long nf) {
  if (u == t) return nf;
  long long ans = 0;
  for (int &i = pre[u]; ~i; i = g[i].nxt) {
    int v = g[i].to;
    if (dep[v] == dep[u] + 1 && g[i].f > 0) {
      long long flow = dfs(v, min(nf, 1ll * g[i].f));
      g[i].f -= flow, g[i ^ 1].f += flow;
      nf -= flow, ans += flow;
      if (!nf) break;
    }
  }
  return ans;
}
inline bool bfs() {
  queue<int> dl;
  while (!dl.empty()) dl.pop();
  for (int i = 0; i <= t; i++) dep[i] = -1;
  dl.push(s);
  dep[s] = 0;
  while (!dl.empty()) {
    int u = dl.front();
    dl.pop();
    for (int i = head[u]; ~i; i = g[i].nxt) {
      int v = g[i].to;
      if (g[i].f > 0 && dep[v] == -1) {
        dep[v] = dep[u] + 1;
        dl.push(v);
      }
    }
  }
  return (~dep[t]);
}
inline long long dinic() {
  long long ans = 0, tot;
  while (bfs()) {
    for (int i = 0; i <= t; i++) pre[i] = head[i];
    while ((tot = dfs(s, 0x3f3f3f3f))) ans += tot;
  }
  return ans;
}
signed main() {
  n = read(), m = read();
  s = n * (m - 1) + m * (n - 1) + 1;
  t = s + 1;
  tot = -1;
  memset(head, -1, sizeof head);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cac[i][j] = getchar();
      while (cac[i][j] != '.' && cac[i][j] != '#') cac[i][j] = getchar();
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (cac[i][j] == '#') {
        int L = (j > 1 && cac[i][j - 1] == '#' ? (i - 1) * (m - 1) + j - 1 : 0);
        int R = (j < m && cac[i][j + 1] == '#' ? (i - 1) * (m - 1) + j : 0);
        int U =
            (i > 1 && cac[i - 1][j] == '#' ? (i - 2) * m + j + n * (m - 1) : 0);
        int D =
            (i < n && cac[i + 1][j] == '#' ? (i - 1) * m + j + n * (m - 1) : 0);
        if (L && U) made(L, U, 1);
        if (L && D) made(L, D, 1);
        if (R && U) made(R, U, 1);
        if (R && D) made(R, D, 1);
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (cac[i][j] == '#') {
        _++;
        if (j < m && cac[i][j + 1] == '#')
          made(s, (i - 1) * (m - 1) + j, 1), _--;
        if (i < n && cac[i + 1][j] == '#')
          made((i - 1) * m + j + n * (m - 1), t, 1), _--;
      }
    }
  }
  printf("%d", _ + dinic());
}
