#include <bits/stdc++.h>
using namespace std;
const int maxn = 500010, INF = 0x3fffffff;
template <class T>
inline T Min(const T &a, const T &b) {
  return a < b ? a : b;
}
int Fir[maxn], Nxt[maxn], Too[maxn], f[maxn], tot = 1;
int n, m, S, T, q[maxn], cur[maxn], dep[maxn];
bool g[220][220];
inline void add(int a, int b, int c) {
  Too[++tot] = b;
  f[tot] = c;
  Nxt[tot] = Fir[a];
  Fir[a] = tot;
  Too[++tot] = a;
  f[tot] = 0;
  Nxt[tot] = Fir[b];
  Fir[b] = tot;
}
inline bool bfs() {
  memset(dep, 0xff, sizeof(dep));
  int h = 0, t = 0;
  q[0] = S, dep[S] = 0, cur[S] = Fir[S];
  while (h <= t) {
    int u = q[h++];
    for (int i = Fir[u]; i; i = Nxt[i]) {
      int v = Too[i];
      if (!~dep[v] && f[i]) {
        cur[v] = Fir[v];
        dep[v] = dep[u] + 1;
        if (v == T) return true;
        q[++t] = v;
      }
    }
  }
  return false;
}
inline int find(int u, int limit) {
  if (u == T) return limit;
  int flow = 0;
  for (int &i = cur[u]; i && flow < limit; i = Nxt[i]) {
    int v = Too[i];
    if (dep[v] == dep[u] + 1 && f[i]) {
      int t = find(v, Min(f[i], limit - flow));
      if (!t)
        dep[v] = -1;
      else
        f[i] -= t, f[i ^ 1] += t, flow += t;
    }
  }
  return flow;
}
inline int Dinic() {
  int flow = 0;
  while (bfs()) flow += find(S, INF);
  return flow;
}
inline int get(int x, int y, int k) { return ((x - 1) * m + y) << 1 | k; }
int main() {
  S = 0, T = 1;
  scanf("%d%d", &n, &m);
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    char s[210];
    scanf("%s", s + 1);
    for (int j = 1; j <= m; ++j) g[i][j] = (s[j] == '#');
  }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      if (!g[i][j]) continue;
      ++cnt;
      if (g[i][j + 1]) {
        add(S, get(i, j, 0), 1);
        --cnt;
        if (g[i + 1][j]) add(get(i, j, 0), get(i, j, 1), 1);
        if (g[i - 1][j]) add(get(i, j, 0), get(i - 1, j, 1), 1);
        if (g[i + 1][j + 1]) add(get(i, j, 0), get(i, j + 1, 1), 1);
        if (g[i - 1][j + 1]) add(get(i, j, 0), get(i - 1, j + 1, 1), 1);
      }
      if (g[i + 1][j]) {
        add(get(i, j, 1), T, 1);
        --cnt;
      }
    }
  printf("%d", cnt + Dinic());
  return 0;
}
