#include <bits/stdc++.h>
#define br cout << "\n";
#define pb push_back
#define ll long long 
#define ff first 
#define ss second
#define all(x) x.begin(),x.end()
#define in(a , idx , n ) for (int i = idx ; i < n ; ++i)cin >>a[i];
#define fix() cout <<fixed <<  std::setprecision(10)
	
using namespace std;
const int MOD = 1000*1000*1000 + 7 ; 
const int MAXN = 1000*1000 +10 ;
const ll INF = 1e18 ;

void solve(){
	string s , t ;
	cin >> s >> t  ;
	if ( s[0] == 'Y')
		cout<<((char)((int)t[0]-32));
	else
		cout << t[0];
	br 

}
	
int main (){
	int t = 1  ;
	// cin >> t ;
	while (t--){
		solve() ; 
	}
    
return 0 ; 
}

#line 1 "C.cpp"
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cout;
using std::cerr;
using std::endl;
using std::cin;

#if defined(DONLINE_JUDGE)
	#define NDEBUG
#elif defined(ONLINE_JUDGE)
	#define NDEBUG
#endif

template<typename T> std::vector<T> make_v(size_t a){return std::vector<T>(a);}
template<typename T, typename... Ts> auto make_v(size_t a, Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

int main() {
	int h, w; scanf("%d%d", &h, &w);
	std::vector<std::string> s(h);
	for(auto& v: s) std::cin >> v;

	int ans = 0;
	for(int i = 0; i < h; i++) {
		for(int j = 0; j < w; j++) {
			if(s[i][j] == '.') {
				if(i - 1 >= 0 and j - 1 >= 0 and s[i - 1][j] == '#' and s[i][j - 1] == '#') ans++;
				if(i - 1 >= 0 and j + 1 <  w and s[i - 1][j] == '#' and s[i][j + 1] == '#') ans++;
				if(i + 1 <  h and j - 1 >= 0 and s[i + 1][j] == '#' and s[i][j - 1] == '#') ans++;
				if(i + 1 <  h and j + 1 <  w and s[i + 1][j] == '#' and s[i][j + 1] == '#') ans++;
			} else {
				if(s[i - 1][j] == '.' and s[i][j - 1] == '.') ans++;
				if(s[i - 1][j] == '.' and s[i][j + 1] == '.') ans++;
				if(s[i + 1][j] == '.' and s[i][j - 1] == '.') ans++;
				if(s[i + 1][j] == '.' and s[i][j + 1] == '.') ans++;
			}
		}
	}
	printf("%d\n", ans);
	return 0;
}
