#include <bits/stdc++.h>
using namespace std;
int second = 200010 - 2, T = 200010 - 1;
int a[205][205][2], dst[200010], ps[200010];
struct edge {
  int a, b, flow, cup;
  edge() {}
  edge(int a_, int b_, int flow_, int cup_)
      : a(a_), b(b_), flow(flow_), cup(cup_) {}
};
vector<int> g[200010];
vector<edge> edges;
void add(int a, int b, int cup) {
  g[a].push_back(int(edges.size()));
  edges.push_back(edge(a, b, 0, cup));
  g[b].push_back(int(edges.size()));
  edges.push_back(edge(b, a, 0, 0));
}
bool bfs() {
  fill(dst, dst + 200010, int(1e9));
  dst[second] = 0;
  queue<int> qr;
  qr.push(second);
  while (int(qr.size())) {
    int v = qr.front();
    qr.pop();
    for (auto it : g[v]) {
      int to = edges[it].b;
      if (dst[to] == 1e9 && edges[it].flow < edges[it].cup) {
        dst[to] = dst[v] + 1;
        qr.push(to);
      }
    }
  }
  return dst[T] != 1e9;
}
int dfs(int v, int pshd) {
  if (pshd == 0) return 0;
  if (v == T) return pshd;
  for (; ps[v] < int(g[v].size()); ps[v]++) {
    int id = g[v][ps[v]];
    edge cur = edges[id];
    if (dst[v] + 1 != dst[cur.b]) continue;
    int get = dfs(cur.b, min(pshd, cur.cup - cur.flow));
    if (get != 0) {
      edges[id].flow += get;
      edges[id ^ 1].flow -= get;
      return get;
    }
  }
  return 0;
}
int main() {
  iostream::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  string s[n];
  for (int i = 0; i < n; i++) cin >> s[i];
  int ans = 0, v = 0;
  for (int i = 0; i < 205; i++)
    for (int j = 0; j < 205; j++) a[i][j][0] = a[i][j][1] = -1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (s[i][j] == '#') {
        ans++;
        if (i > 0 && s[i - 1][j] == '#') {
          a[i][j][0] = v++;
          ans--;
          add(second, a[i][j][0], 1);
        }
        if (j > 0 && s[i][j - 1] == '#') {
          a[i][j][1] = v++;
          ans--;
          add(a[i][j][1], T, 1);
        }
      }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (s[i][j] == '#') {
        if (a[i][j][0] != -1 && a[i][j + 1][1] != -1)
          add(a[i][j][0], a[i][j + 1][1], 1);
        if (a[i][j][0] != -1 && a[i][j][1] != -1)
          add(a[i][j][0], a[i][j][1], 1);
        if (a[i][j][1] != -1 && a[i + 1][j][0] != -1)
          add(a[i + 1][j][0], a[i][j][1], 1);
        if (a[i][j + 1][1] != -1 && a[i + 1][j][0] != -1)
          add(a[i + 1][j][0], a[i][j + 1][1], 1);
      }
  int flow = 0;
  while (bfs()) {
    fill(ps, ps + 200010, 0);
    int psh = dfs(second, 1e9);
    while (psh > 0) {
      flow += psh;
      psh = dfs(second, 1e9);
    }
  }
  cout << ans + flow << endl;
}
