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>
using namespace std;
using ll = long long;
using ld = long double;
using db = double;
using str = string;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pd = pair<db, db>;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<ll>;
using vd = vector<db>;
using vs = vector<str>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpd = vector<pd>;
template <class T>
using V = vector<T>;
template <class T, size_t SZ>
using AR = array<T, SZ>;
const int MOD = 1e9 + 7;
const int MX = 2e5 + 5;
const ll INF = 1e18;
const ld PI = acos((ld)-1);
const int xd[4] = {1, 0, -1, 0}, yd[4] = {0, 1, 0, -1};
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());
constexpr int pct(int x) { return __builtin_popcount(x); }
constexpr int bits(int x) { return 31 - __builtin_clz(x); }
ll cdiv(ll a, ll b) { return a / b + ((a ^ b) > 0 && a % b); }
ll fdiv(ll a, ll b) { return a / b - ((a ^ b) < 0 && a % b); }
ll half(ll x) { return fdiv(x, 2); }
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
template <class T, class U>
T fstTrue(T lo, T hi, U first) {
  hi++;
  assert(lo <= hi);
  while (lo < hi) {
    T mid = half(lo + hi);
    first(mid) ? hi = mid : lo = mid + 1;
  }
  return lo;
}
template <class T, class U>
T lstTrue(T lo, T hi, U first) {
  lo--;
  assert(lo <= hi);
  while (lo < hi) {
    T mid = half(lo + hi + 1);
    first(mid) ? lo = mid : hi = mid - 1;
  }
  return lo;
}
template <class T>
void remDup(vector<T>& v) {
  sort(begin(v), end(v));
  v.erase(unique(begin(v), end(v)), end(v));
}
template <class T, class U>
void erase(T& t, const U& u) {
  auto it = t.find(u);
  assert(it != end(t));
  t.erase(u);
}
template <class T>
void re(complex<T>& c);
template <class T, class U>
void re(pair<T, U>& p);
template <class T>
void re(vector<T>& v);
template <class T, size_t SZ>
void re(AR<T, SZ>& a);
template <class T>
void re(T& x) {
  cin >> x;
}
void re(db& d) {
  str t;
  re(t);
  d = stod(t);
}
void re(ld& d) {
  str t;
  re(t);
  d = stold(t);
}
template <class T, class... U>
void re(T& t, U&... u) {
  re(t);
  re(u...);
}
template <class T>
void re(complex<T>& c) {
  T a, b;
  re(a, b);
  c = {a, b};
}
template <class T, class U>
void re(pair<T, U>& p) {
  re(p.first, p.second);
}
template <class T>
void re(vector<T>& x) {
  for (auto& a : x) re(a);
}
template <class T, size_t SZ>
void re(AR<T, SZ>& x) {
  for (auto& a : x) re(a);
}
str to_string(char c) { return str(1, c); }
str to_string(const char* second) { return (str)second; }
str to_string(str second) { return second; }
str to_string(bool b) { return to_string((int)b); }
template <class T>
str to_string(complex<T> c) {
  stringstream ss;
  ss << c;
  return ss.str();
}
str to_string(vector<bool> v) {
  str res = "{";
  for (int i = (0); i < ((int)(v).size()); ++i) res += char('0' + v[i]);
  res += "}";
  return res;
}
template <size_t SZ>
str to_string(bitset<SZ> b) {
  str res = "";
  for (int i = (0); i < (SZ); ++i) res += char('0' + b[i]);
  return res;
}
template <class T, class U>
str to_string(pair<T, U> p);
template <class T>
str to_string(T v) {
  bool fst = 1;
  str res = "";
  for (const auto& x : v) {
    if (!fst) res += " ";
    fst = 0;
    res += to_string(x);
  }
  return res;
}
template <class T, class U>
str to_string(pair<T, U> p) {
  return to_string(p.first) + " " + to_string(p.second);
}
template <class T>
void pr(T x) {
  cout << to_string(x);
}
template <class T, class... U>
void pr(const T& t, const U&... u) {
  pr(t);
  pr(u...);
}
void ps() { pr("\n"); }
template <class T, class... U>
void ps(const T& t, const U&... u) {
  pr(t);
  if (sizeof...(u)) pr(" ");
  ps(u...);
}
void DBG() { cerr << "]" << endl; }
template <class T, class... U>
void DBG(const T& t, const U&... u) {
  cerr << to_string(t);
  if (sizeof...(u)) cerr << ", ";
  DBG(u...);
}
void setIn(str second) { freopen(second.c_str(), "r", stdin); }
void setOut(str second) { freopen(second.c_str(), "w", stdout); }
void unsyncIO() { cin.tie(0)->sync_with_stdio(0); }
void setIO(str second = "") {
  unsyncIO();
  if ((int)(second).size()) {
    setIn(second + ".in"), setOut(second + ".out");
  }
}
template <int SZ>
struct Dinic {
  int N, second, t;
  typedef ll F;
  struct Edge {
    int to, rev;
    F flo, cap;
  };
  vector<Edge> adj[SZ];
  void reset() {
    for (int i = (0); i < (N); ++i)
      for (auto& e : adj[i]) e.flo = 0;
  }
  void ae(int u, int v, F cap, F rcap = 0) {
    assert(min(cap, rcap) >= 0);
    Edge a{v, (int)(adj[v]).size(), 0, cap},
        b{u, (int)(adj[u]).size(), 0, rcap};
    adj[u].push_back(a), adj[v].push_back(b);
  }
  int lev[SZ];
  typename vector<Edge>::iterator cur[SZ];
  bool bfs() {
    for (int i = (0); i < (N); ++i) lev[i] = -1, cur[i] = begin(adj[i]);
    queue<int> q({second});
    lev[second] = 0;
    while ((int)(q).size()) {
      int u = q.front();
      q.pop();
      for (auto& e : adj[u])
        if (lev[e.to] < 0 && e.flo < e.cap)
          q.push(e.to), lev[e.to] = lev[u] + 1;
    }
    return lev[t] >= 0;
  }
  F dfs(int v, F flo) {
    if (v == t) return flo;
    for (; cur[v] != end(adj[v]); cur[v]++) {
      Edge& e = *cur[v];
      if (lev[e.to] != lev[v] + 1 || e.flo == e.cap) continue;
      F df = dfs(e.to, min(flo, e.cap - e.flo));
      if (df) {
        e.flo += df;
        adj[e.to][e.rev].flo -= df;
        return df;
      }
    }
    return 0;
  }
  F maxFlow(int _N, int _s, int _t) {
    N = _N, second = _s, t = _t;
    assert(second != t);
    F tot = 0;
    while (bfs())
      while (F df = dfs(second, numeric_limits<F>::max())) tot += df;
    return tot;
  }
};
int u[200][200];
int d[200][200];
int l[200][200];
int r[200][200];
bool black[200][200];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int row, c;
  cin >> row >> c;
  int point = 2;
  int tot = 0;
  for (int i = 0; i < row; i++) {
    string second;
    cin >> second;
    for (int j = 0; j < c; j++) {
      black[i][j] = (second[j] == '#');
      if (black[i][j]) {
        tot++;
      }
    }
  }
  for (int i = 0; i < row; i++) {
    for (int j = 0; j < c; j++) {
      d[i][j] = point++;
      if (i + 1 < row) {
        u[i + 1][j] = d[i][j];
      }
    }
  }
  for (int j = 0; j < c; j++) {
    u[0][j] = point++;
  }
  for (int i = 0; i < row; i++) {
    for (int j = 0; j < c; j++) {
      r[i][j] = point++;
      if (j + 1 < c) {
        l[i][j + 1] = r[i][j];
      }
    }
  }
  for (int i = 0; i < row; i++) {
    l[i][0] = point++;
  }
  int possible = 0;
  Dinic<80405> flow;
  for (int i = 0; i + 1 < row; i++) {
    for (int j = 0; j < c; j++) {
      if (black[i][j] && black[i + 1][j]) {
        possible++;
        flow.ae(0, d[i][j], 1);
        flow.ae(d[i][j], l[i][j], 1);
        flow.ae(d[i][j], r[i][j], 1);
        flow.ae(d[i][j], l[i + 1][j], 1);
        flow.ae(d[i][j], r[i + 1][j], 1);
      }
    }
  }
  for (int i = 0; i < row; i++) {
    for (int j = 0; j + 1 < c; j++) {
      if (black[i][j] && black[i][j + 1]) {
        possible++;
        flow.ae(r[i][j], 1, 1);
        flow.ae(u[i][j], r[i][j], 1);
        flow.ae(d[i][j], r[i][j], 1);
        flow.ae(u[i][j + 1], r[i][j], 1);
        flow.ae(d[i][j + 1], r[i][j], 1);
      }
    }
  }
  int got = flow.maxFlow(point, 0, 1);
  int ans = tot - possible + got;
  cout << ans << endl;
}
