'\' ,'/'个数为奇数时,多边形还没封闭 此时'.'占据单位面积
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
const int N=1e3+20;
char g[N][N];
int h,w;
int main()
{
while(cin>>h>>w)
{
for(int i=0;i<h;i++)
scanf("%s",g[i]);
double ans=0;
int cnt=0;
for(int i=0;i<h;i++)
{
for(int j=0;j<w;j++)
{
if(g[i][j]!='.')
{
cnt++;
ans+=0.5;
}
else
{
//'\' '/'个数为奇数时,多边形还没封闭
if(cnt%2)//判断(i,j)是否在多边形内
ans++;
}
}
}
cout<<ans<<endl;
}
return 0;
}