#include<bits/stdc++.h>
#define maxn 1000005
#define inf 0x7fffffffffff
#define mod 1000000007
#define mst(a,x) memset(a,x,sizeof(a))
#define up(l,r,i) for(LL i=l;i<=r;i++)
#define down(l,r,i) for(LL i=l;i>=r;i--)
#define in(l,r,a) for(LL i=l;i<=r;i++)cin>>a[i]
#define out(l,r,a) for(LL i=l;i<=r;i++)cout<<a[i]<<" "
#define injz(n,m,a) for(LL i=1;i<=n;i++)for(LL j=1;j<=m;j++)cin>>a[i][j]
#define st(a,n) sort(a+1,a+n+1)
#define sta(v) sort(v.begin(),v.end())
#define endl "\n"
#define hh cout<<endl
#define pb push_back
#define cf cin>>T;while(T--)
#define xh(n) U=n;while(U--)
#define cfout(x) cout<<(x?"YES":"NO")<<endl
#define cs cerr<<"qaq"<<endl
#define dbg(n) cerr<<n<<endl
typedef long long LL;LL T,U;
typedef double db;
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    #ifdef ONLINE_JUDGE
    #else
    //freopen("bwxnQAQin.txt","r",stdin);
    //freopen("bwxnQAQout.txt","w",stdout);
    #endif
    LL n,k,ans=0;
    cin>>n>>k;
    up(1,n,i)
    {
        up(1,k,j)ans+=100*i+j;
    }
    cout<<ans<<endl;
    cerr<<"Time : "<<1000*((double)clock())/(double)CLOCKS_PER_SEC<<"ms";
    return 0;
}

//#pragma GCC optimize ("O2")
//#pragma GCC target ("avx2")
#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	int H, W;
	cin >> H >> W;

	string S[10];
	rep(i, H) cin >> S[i];

	int kotae = 0;
	rep(i, H - 1) rep(j, W - 1) {
		int k = 0;
		if (S[i][j] == '#') k++;
		if (S[i][j + 1] == '#') k++;
		if (S[i + 1][j] == '#') k++;
		if (S[i + 1][j + 1] == '#') k++;

		if (k % 2) kotae++;
	}

	co(kotae);

	Would you please return 0;
}