#include #define N 1005 using namespace std; int n,st,ans; bool odd[N],mark[N]; char str[N][N]; inline void Rd(int &res){ char c;res=0; while(c=getchar(),c<48); do res=(res<<3)+(res<<1)+(c^48); while(c=getchar(),c>47); return; } inline bool check(){ int cnt=0; for(int i=1;i<=n;i++){ cnt+=odd[i]; if(cnt>2)return false; } if(cnt==2&&!odd[st])return false; return true; } int blk; bool key; void dfs(int x){ mark[x]=1;blk++; if(x==st)key=1; for(int i=1;i1||key)ans+=2,key=0; } ans-=2; printf("%d\n",ans); } return 0; }