#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 1e8;
const int N = 111111;
const int M = 1111111;
int fst[N], nxt[M], to[M];
int cap[M];
int dis[N], q[N], ptr[N];
int V, E;
void init() {
  memset(fst, -1, sizeof fst);
  V = E = 0;
}
inline int add_node() {
  V++;
  return V - 1;
}
inline void add_edge(int u, int v, int c) {
  to[E] = v, cap[E] = c, nxt[E] = fst[u], fst[u] = E++;
  to[E] = u, cap[E] = 0, nxt[E] = fst[v], fst[v] = E++;
}
inline bool bfs(int S, int T, int n) {
  memset(dis, -1, sizeof(int) * n);
  int h = 0, t = 0;
  dis[S] = 0, q[t++] = S;
  while (h < t) {
    int u = q[h++];
    for (int e = fst[u]; ~e; e = nxt[e])
      if (cap[e] > 0 && dis[to[e]] == -1) {
        dis[to[e]] = dis[u] + 1, q[t++] = to[e];
        if (to[e] == T) return 1;
      }
  }
  return (dis[T] != -1);
}
int dfs(int u, int T, int f) {
  if (u == T) return f;
  for (int &e = ptr[u]; ~e; e = nxt[e])
    if (cap[e] > 0 && dis[to[e]] > dis[u]) {
      int ret = dfs(to[e], T, min(f, cap[e]));
      if (ret > 0) {
        cap[e] -= ret, cap[e ^ 1] += ret;
        return ret;
      }
    }
  return 0;
}
int max_flow(int S, int T, int n = V) {
  int ret = 0;
  while (bfs(S, T, n)) {
    memcpy(ptr, fst, sizeof(int) * n);
    for (int cur; (cur = dfs(S, T, INF)) > 0; ret += cur)
      ;
  }
  return ret;
}
char s[210][210];
int R[210][210], D[210][210];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  init();
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  int total = 0;
  int S = 2 * n * m, T = 2 * n * m + 1, num = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '#') {
        total++;
        int cnt = 0;
        if (j != m - 1 && s[i][j + 1] == '#') {
          cnt++;
          add_edge(num, T, 1);
          R[i][j] = num;
          num++;
        }
        if (i != n - 1 && s[i + 1][j] == '#') {
          cnt++;
          add_edge(S, num, 1);
          D[i][j] = num;
          num++;
        }
        if (cnt == 2) {
          add_edge(num - 1, num - 2, 1);
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (i && j != m - 1 && s[i][j] == '#' && s[i - 1][j] == '#' &&
          s[i][j + 1] == '#') {
        add_edge(D[i - 1][j], R[i][j], 1);
      }
      if (j && i != n - 1 && s[i][j] == '#' && s[i][j - 1] == '#' &&
          s[i + 1][j] == '#') {
        add_edge(D[i][j], R[i][j - 1], 1);
      }
      if (i && j && s[i][j] == '#' && s[i][j - 1] == '#' &&
          s[i - 1][j] == '#') {
        add_edge(D[i - 1][j], R[i][j - 1], 1);
      }
    }
  }
  int ret = max_flow(S, T, 2 * n * m + 5);
  cout << total - (num - ret) << '\n';
  return 0;
}
