#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long num = 0, neg = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') neg = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    num = (num << 3) + (num << 1) + c - '0';
    c = getchar();
  }
  return num * neg;
}
int n, m, row[210][210], col[210][210], tot, dis[500010], maxflow, ans;
char str[210][210];
int cnt = 1, to[1000010], nxt[1000010], head[500010], val[1000010];
inline void insert(int x, int y, int z) {
  to[++cnt] = y, nxt[cnt] = head[x], head[x] = cnt, val[cnt] = z;
  to[++cnt] = x, nxt[cnt] = head[y], head[y] = cnt, val[cnt] = 0;
}
inline bool bfs() {
  queue<int> line;
  for (int i = 0; i <= tot + 1; i++) dis[i] = 0;
  dis[0] = 1, line.push(0);
  while (!line.empty()) {
    int u = line.front();
    line.pop();
    for (int i = head[u]; i; i = nxt[i]) {
      int v = to[i];
      if (dis[v] || !val[i]) continue;
      dis[v] = dis[u] + 1;
      line.push(v);
      if (v == tot + 1) return 1;
    }
  }
  return 0;
}
inline int dinic(int now, int x) {
  if (now == tot + 1) return x;
  int res = x;
  for (int i = head[now]; i && res; i = nxt[i]) {
    int v = to[i];
    if (dis[v] != dis[now] + 1 || !val[i]) continue;
    int flow = dinic(v, min(val[i], res));
    if (flow) {
      val[i] -= flow;
      val[i ^ 1] += flow;
      res -= flow;
    } else
      dis[v] = 0;
  }
  return x - res;
}
inline void MF() {
  int flow;
  while (bfs()) {
    while (flow = dinic(0, 2e9)) maxflow += flow;
  }
  return;
}
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; i++) scanf("%s", str[i] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (str[i][j] == '#') {
        ans++;
        if (str[i + 1][j] == '#') row[i][j] = ++tot;
        if (str[i][j + 1] == '#') col[i][j] = ++tot;
      }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (col[i][j - 1]) {
        if (row[i - 1][j]) insert(col[i][j - 1], row[i - 1][j], 1);
        if (row[i][j]) insert(col[i][j - 1], row[i][j], 1);
      }
      if (col[i][j]) {
        if (row[i - 1][j]) insert(col[i][j], row[i - 1][j], 1);
        if (row[i][j]) insert(col[i][j], row[i][j], 1);
      }
      if (col[i][j]) insert(0, col[i][j], 1);
      if (row[i][j]) insert(row[i][j], tot + 1, 1);
    }
  }
  MF();
  printf("%d\n", ans - (tot - maxflow));
  return 0;
}
