#include <bits/stdc++.h>

using namespace std;


typedef long long ll;

#define vt vector
#define all(x) x.begin(), x.end()
#define trav(i, x) for(auto &i : x)
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define eb emplace_back
#define top front
void solve() {
    int n, m; scanf("%d%d", &n, &m);
    vector<vector<char>> G(n, vector<char> (m));
    for(int i = 0; i < n; i++) {
		for(int j = 0; j < m; j++) {
			cin >> G[i][j];
		}
	}
	int row_count = 0;
	for(int i = 0; i < n - 1; i++) {
		for(int j = 0; j < m - 1; j++) {
			int c=0;
			c += G[i][j]=='#';
			c += G[i+1][j]=='#';
			c += G[i][j+1]=='#';
			c += G[i+1][j+1]=='#';
			if(c==1||c==3) row_count++;
		}
	}
	
	printf("%d", row_count);
	
}
int main() {

	int t = 1, i = 1;
	while(t--) {
		// printf("Case #%d: ", i)
		solve();
		i++;
	}
}

#include <bits/stdc++.h>
using namespace std;

template <class A, class B> bool cmin(A& a, B b) { return a > b && (a = b, true); }
template <class A, class B> bool cmax(A& a, B b) { return a < b && (a = b, true); }

signed main() {
  cin.tie(nullptr)->sync_with_stdio(false);

  int N, X;
  cin >> N >> X;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A.at(i);

  for (const auto& a : A) {
    if (a == X) continue;
    cout << a << '\n';
  }
}