#include using namespace std; inline int read() { int x=0,f=1; char ch=getchar(); while(ch<'0'||ch>'9') { if(ch=='-')f=-1; ch=getchar(); } while(ch>='0'&&ch<='9') { x=(x<<1)+(x<<3)+(ch&15); ch=getchar(); } return x*f; } inline void write(int x) { if(x<0) { putchar('-'); x=-x; } if(x>9)write(x/10); putchar(x%10+'0'); return; } const int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1}; char cl[100][100]; int cnt[2],match[2][10010],pre[10010],vis[10010]; vector>pk; inline int syh() { memset(match,-1,sizeof match); memset(vis,-1,sizeof vis); int l=pk.size(); for(int i=0;ist; st.push(i); vis[i]=i,pre[i]=-1; bool fg=0; while(!st.empty()) { int tp=st.top(); st.pop(); for(auto dg:pk[tp]) { int k=match[1][dg]; if(k==-1) { while(~tp) { match[1][dg]=tp; swap(dg,match[0][tp]); tp=pre[tp]; } fg=1; break; } else if(vis[k]=n||y<0||y>=m||cl[x][y]=='.')continue; pk[pos].emplace_back(x*m+y); } } } } int s1=syh(); int s2=min(cnt[0],cnt[1])-s1; int s3=cnt[0]+cnt[1]-(s1+s2)*2; write(s1*100+s2*10+s3); return 0; }