#include <bits/stdc++.h>
using namespace std;
const int N = 205;
const int M = 120005;
int n, m, tot = 1, nd;
char s[N][N];
int id[N][N];
int S, T, q[M], head[M];
int dis[M], ans;
struct edge {
  int to, next, f;
} e[M * 10];
void add(int x, int y, int f) {
  e[++tot] = (edge){y, head[x], f};
  head[x] = tot;
  e[++tot] = (edge){x, head[y], 0};
  head[y] = tot;
}
bool bfs() {
  for (int i = (int)(1); i <= (int)(nd); i++) dis[i] = -1;
  int h = 0, t = 1;
  q[1] = S;
  dis[S] = 0;
  while (h != t) {
    int x = q[++h];
    for (int i = head[x]; i; i = e[i].next)
      if (dis[e[i].to] == -1 && e[i].f) {
        dis[e[i].to] = dis[x] + 1;
        q[++t] = e[i].to;
        if (e[i].to == T) return 1;
      }
  }
  return 0;
}
int dfs(int x, int flow) {
  if (x == T) return flow;
  int k, rest = flow;
  for (int i = head[x]; i && rest; i = e[i].next)
    if (dis[e[i].to] == dis[x] + 1 && e[i].f) {
      k = dfs(e[i].to, min(rest, e[i].f));
      e[i].f -= k;
      e[i ^ 1].f += k;
      rest -= k;
    }
  if (rest) dis[x] = -1;
  return flow - rest;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = (int)(1); i <= (int)(n); i++) scanf("%s", s[i] + 1);
  for (int i = (int)(1); i <= (int)(n); i++)
    for (int j = (int)(1); j <= (int)(m); j++)
      if (s[i][j] == '#') id[i][j] = ++nd;
  int ans = 0;
  S = ++nd;
  T = ++nd;
  for (int i = (int)(1); i <= (int)(n); i++)
    for (int j = (int)(1); j <= (int)(m); j++)
      if (s[i][j] == '#') {
        add(S, id[i][j], 1);
        add(id[i][j], T, 1);
      }
  for (int i = (int)(1); i <= (int)(n); i++)
    for (int j = (int)(1); j <= (int)(m); j++)
      if (s[i][j] == '#' && s[i + 1][j] == '#') {
        ++nd;
        --ans;
        add(S, nd, 1);
        add(nd, id[i][j], 1 << 30);
        add(nd, id[i + 1][j], 1 << 30);
      }
  for (int i = (int)(1); i <= (int)(n); i++)
    for (int j = (int)(1); j <= (int)(m); j++)
      if (s[i][j] == '#' && s[i][j + 1] == '#') {
        ++nd;
        --ans;
        add(nd, T, 1);
        add(id[i][j], nd, 1 << 30);
        add(id[i][j + 1], nd, 1 << 30);
      }
  for (; bfs(); ans += dfs(S, 1 << 30))
    ;
  cout << ans << endl;
}
