#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int maxn = 210;
const long long mod = 1e9 + 7;
long long pw(long long a, long long b, long long md = mod) {
  long long res = 1;
  while (b) {
    if (b & 1) {
      res = (a * res) % md;
    }
    a = (a * a) % md;
    b >>= 1;
  }
  return (res);
}
int n, m;
string s[maxn];
struct hopcroft {
  int n, m, flow = 0;
  vector<vector<int>> adj;
  vector<int> pu, pv;
  hopcroft(int n, int m) : n(n), m(m), pu(n, -1), pv(m, -1), cur(n), adj(n) {}
  int add_edge(int from, int to) {
    adj[from].push_back(to);
    return (int)adj[from].size() - 1;
  }
  int id = 0;
  vector<int> cur;
  bool dfs(int u) {
    cur[u] = id;
    for (auto v : adj[u])
      if (!~pv[v]) {
        pu[u] = v, pv[v] = u;
        return true;
      }
    for (auto v : adj[u])
      if (cur[pv[v]] != id && dfs(pv[v])) {
        pu[u] = v, pv[v] = u;
        return true;
      }
    return false;
  }
  int solve() {
    while (true) {
      int augment = 0;
      ++id;
      for (int u = 0; u < n; ++u)
        if (pu[u] == -1 && dfs(u)) ++augment;
      if (!augment) break;
      flow += augment;
    }
    return flow;
  }
  int run_once(int v) {
    if (pu[v] != -1) return 0;
    ++id;
    return dfs(v);
  }
};
int dx1[] = {0, -1, 0, -1};
int dy1[] = {1, 0, -1, 0};
int dx2[] = {1, 0, 1, 0};
int dy2[] = {0, 1, 0, -1};
int px1[] = {0, 0, 0, 0};
int py1[] = {0, 0, -1, -1};
int px2[] = {0, -1, 0, -1};
int py2[] = {0, 0, 0, 0};
int32_t main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> s[i];
  hopcroft g(n * (m - 1), m * (n - 1));
  int sz = 0, cnt = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (s[i][j] == '#') {
        cnt++;
        if (i and s[i - 1][j] == '#') sz++;
        if (j and s[i][j - 1] == '#') sz++;
        for (int k = 0; k < 4; k++) {
          if (i + dx1[k] < 0 or i + dx1[k] >= n) continue;
          if (j + dy1[k] < 0 or j + dy1[k] >= m) continue;
          if (s[i + dx1[k]][j + dy1[k]] != '#') continue;
          if (i + dx2[k] < 0 or i + dx2[k] >= n) continue;
          if (j + dy2[k] < 0 or j + dy2[k] >= m) continue;
          if (s[i + dx2[k]][j + dy2[k]] != '#') continue;
          g.add_edge((i + px1[k]) * (m - 1) + (j + py1[k]),
                     (i + px2[k]) * m + (j + py2[k]));
        }
      }
  cout << cnt - sz + g.solve();
  return (0);
}
