#include <bits/stdc++.h>
using namespace std;
const long long NMAX = 201 * 201 * 2;
const long long INF = (1LL << 60) - 1;
const long long MOD = 1000000007;
const long long BLOCK = 101;
const long long nr_of_bits = 19;
const long long lim = 10000;
int n, m, cnt;
vector<int> v[NMAX];
char mat[202][202];
int cod(pair<long long, long long> a) {
  int i = a.first;
  int j = a.second;
  return (i - 1) * m + j;
}
map<pair<int, int>, int> mp;
vector<int> vert;
void add(pair<long long, long long> a, pair<long long, long long> b, bool pun) {
  pair<long long, long long> idx = {cod(a), cod(b)};
  cnt++;
  if (pun) {
    vert.push_back(cnt);
  }
  mp[idx] = cnt;
}
int match[NMAX];
int viz[NMAX];
bool DFS(int node) {
  viz[node] = 1;
  for (auto x : v[node]) {
    if (!viz[x]) {
      if (!match[x]) {
        match[x] = node;
        match[node] = x;
        return 1;
      }
      if (!viz[match[x]] && DFS(match[x])) {
        match[x] = node;
        match[node] = x;
        return 1;
      }
    }
  }
  return 0;
}
int Match() {
  int ok = 1;
  while (ok) {
    ok = 0;
    for (int i = 1; i <= cnt; i++) {
      viz[i] = 0;
    }
    for (int i = 0; i < vert.size(); i++) {
      int x = vert[i];
      if (!viz[x] && !match[x] && DFS(x)) {
        ok = 1;
      }
    }
  }
  int matching = 0;
  for (int i = 0; i < vert.size(); i++) {
    int x = vert[i];
    if (match[x]) matching++;
  }
  return matching;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int i, j, nr = 0;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      cin >> mat[i][j];
      if (mat[i][j] != '#') continue;
      nr++;
      if (mat[i - 1][j] == '#') {
        add({i - 1, j}, {i, j}, 0);
      }
      if (mat[i][j - 1] == '#') {
        add({i, j - 1}, {i, j}, 1);
      }
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (mat[i][j] != '#') {
        continue;
      }
      int now = cod({i, j});
      int up = cod({i - 1, j});
      int down = cod({i + 1, j});
      int left = cod({i, j - 1});
      int right = cod({i, j + 1});
      if (mat[i - 1][j] == '#' && mat[i][j + 1] == '#') {
        int a = mp[{up, now}];
        int b = mp[{now, right}];
        v[a].push_back(b);
        v[b].push_back(a);
      }
      if (mat[i + 1][j] == '#' && mat[i][j + 1] == '#') {
        int a = mp[{now, down}];
        int b = mp[{now, right}];
        v[a].push_back(b);
        v[b].push_back(a);
      }
      if (mat[i + 1][j] == '#' && mat[i][j - 1] == '#') {
        int a = mp[{left, now}];
        int b = mp[{now, down}];
        v[a].push_back(b);
        v[b].push_back(a);
      }
      if (mat[i - 1][j] == '#' && mat[i][j - 1] == '#') {
        int a = mp[{up, now}];
        int b = mp[{left, now}];
        v[a].push_back(b);
        v[b].push_back(a);
      }
    }
  }
  int MVC = Match();
  cout << nr - (cnt - MVC);
  return 0;
}
