A brick is defined as a rectangle with integer side lengths with either width 1 or height 1 (or both).

There is an n× m grid, and each cell is colored either black or white. A tiling is a way to place bricks onto the grid such that each black cell is covered by exactly one brick, and each white cell is not covered by any brick. In other words, bricks are placed on black cells only, cover all black cells, and no two bricks overlap.

<image> An example tiling of the first test case using 5 bricks. It is possible to do better, using only 4 bricks. 

What is the minimum number of bricks required to make a valid tiling?

Input

The first line contains two integers n, m (1≤ n, m≤ 200) — the number of rows and columns, respectively.

The next n lines describe the grid. The i-th of these lines contains a string of length m, where the j-th character denotes the color of the cell in row i, column j. A black cell is given by "#", and a white cell is given by ".".

It is guaranteed that there is at least one black cell.

Output

Output a single integer, the minimum number of bricks required.

Examples

Input


3 4
#.##
####
##..


Output


4


Input


6 6
######
##....
######
##...#
##...#
######


Output


6


Input


10 8
####..##
#..#.##.
#..#.###
####.#.#
....####
.###.###
###.#..#
########
###..###
.##.###.


Output


18

Note

The first test case can be tiled with 4 bricks placed vertically.

The third test case can be tiled with 18 bricks like this:

<image>
#include <bits/stdc++.h>
#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("sse4.2")
using namespace std;
mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());
template <class T, class U>
inline bool chmax(T &x, U y) {
  return x < y ? x = y, 1 : 0;
}
template <class T, class U>
inline bool chmin(T &x, U y) {
  return x > y ? x = y, 1 : 0;
}
template <class T>
inline void sort(T &a) {
  sort((a).begin(), (a).end());
}
template <class T>
inline void rsort(T &a) {
  sort((a).rbegin(), (a).rend());
}
template <class T>
inline void reverse(T &a) {
  reverse((a).begin(), (a).end());
}
template <class T, class U>
inline istream &operator>>(istream &str, pair<T, U> &p) {
  return str >> p.first >> p.second;
}
template <class T>
inline istream &operator>>(istream &str, vector<T> &a) {
  for (auto &i : a) str >> i;
  return str;
}
template <class T>
inline T sorted(T a) {
  sort(a);
  return a;
}
void read() {}
void print() {}
void println() { cout << '\n'; }
template <class T, class... U>
void read(T &x, U &...u) {
  cin >> x;
  read(u...);
}
template <class T, class... U>
void print(const T &x, const U &...u) {
  cout << x;
  print(u...);
}
template <class T, class... U>
void println(const T &x, const U &...u) {
  cout << x;
  println(u...);
}
template <class F>
struct Dinic {
  struct Edge {
    int v, rev;
    F flow;
    Edge() {}
    Edge(int _v, F _cap, F _flow, int _rev)
        : v(_v), flow(_flow - _cap), rev(_rev) {}
    inline bool sat() const { return flow >= 0; }
    inline bool unsat() const { return flow < 0; }
    inline F left() const { return -flow; }
    inline void addFlow(F x) { flow += x; }
  };
  vector<vector<Edge>> G;
  vector<int> layer, ptr;
  int n, second, t;
  Dinic(int _n) : n(_n) {
    G.resize(n);
    layer.resize(n);
  }
  void addEdge(int u, int v, F c) {
    int pu = signed((G[u]).size()), pv = signed((G[v]).size());
    G[u].push_back({v, c, 0, pv});
    G[v].push_back({u, 0, 0, pu});
  }
  bool buildBfsTree() {
    for (int i = 0; i < n; ++i) layer[i] = -1;
    queue<int> que({second});
    layer[second] = 0;
    while (signed((que).size())) {
      auto first = que.front();
      que.pop();
      if (first == t) break;
      for (auto i : G[first])
        if (layer[i.v] == -1 && i.unsat()) {
          layer[i.v] = layer[first] + 1;
          que.push(i.v);
        }
    }
    return layer[t] >= 0;
  }
  F sendFlow(int v, F first) {
    if (v == t) return first;
    for (; ptr[v] < signed((G[v]).size()); ++ptr[v]) {
      Edge &e = G[v][ptr[v]];
      if (layer[e.v] != layer[v] + 1 || e.sat()) continue;
      auto d = sendFlow(e.v, min(first, e.left()));
      if (d > 0) {
        e.addFlow(d);
        G[e.v][e.rev].addFlow(-d);
        return d;
      }
    }
    return 0;
  }
  F findFlow(int _s, int _t) {
    second = _s, t = _t;
    F ans = 0;
    while (buildBfsTree()) {
      ptr.assign(n, 0);
      while (F df = sendFlow(second, numeric_limits<F>::max())) ans += df;
    }
    return ans;
  }
};
int n, m;
int get(int i, int j, int ni, int nj) {
  return (min(i, ni) * m + min(j, nj)) * 2 + (j != nj);
}
bool ok(int i, int j) { return i >= 0 && i < n && j >= 0 && j < m; }
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(12);
  read(n, m);
  vector<string> in(n);
  read(in);
  int sz = 2 * n * m + 2;
  int second = sz - 2, t = sz - 1;
  Dinic<int> fl(sz);
  vector<pair<int, int>> d = {{0, 1}, {-1, 0}, {0, -1}, {1, 0}};
  int cnt = 0, vert = 0;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if (in[i][j] == '#') {
        ++cnt;
        for (auto d : d) {
          int ni = i + d.first, nj = j + d.second;
          if ((ni > i || nj > j) && ok(ni, nj) && in[ni][nj] == '#') {
            int ind = get(i, j, ni, nj);
            if (ind & 1)
              fl.addEdge(ind, t, 1);
            else
              fl.addEdge(second, ind, 1);
            ++vert;
          }
        }
        for (int x = 0; x < 4; ++x) {
          int y = x + 1 & 3;
          int i1 = i + d[x].first, j1 = j + d[x].second, i2 = i + d[y].first,
              j2 = j + d[y].second;
          if (ok(i1, j1) && ok(i2, j2) && in[i1][j1] == '#' &&
              in[i2][j2] == '#') {
            int ind1 = get(i, j, i1, j1), ind2 = get(i, j, i2, j2);
            assert(ind1 % 2 + ind2 % 2 == 1);
            if (ind1 & 1) swap(ind1, ind2);
            fl.addEdge(ind1, ind2, 1);
          }
        }
      }
  println(cnt - (vert - fl.findFlow(second, t)));
  return 0;
}
