#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long LL;
int n;
char s[64];
bool w[64][64];
LL f[64][64][64],g[64][64][64][64];
LL dfs2(short,short,short,short);
LL dfs1(short a,short b,short c){
	if (f[a][b][c]!=-1) return f[a][b][c];
	f[a][b][c]=0;
	if ((c-a)&1) return 0;
	if (a<c&&(a==b||b==c)) return 0;
	if (a==b&&b==c) return f[a][b][c]=1;
	for (short p=a;p<b;++p)
		for (short q=b+1;q<=c;++q)
			if (w[p][q])
				for (short i=p;i<b;++i)
					f[a][b][c]+=dfs1(a,p,i)*dfs2(i+1,b,q,c);
	return f[a][b][c];
}
LL dfs2(short a,short b,short q,short c){
	if (g[a][b][q][c]!=-1) return g[a][b][q][c];
	g[a][b][q][c]=0;
	for (short i=b+1;i<=q;++i)
		g[a][b][q][c]+=dfs1(a,b,i-1)*dfs1(i,q,c);
	return g[a][b][q][c];
}
int main()
{
	scanf("%d",&n),n<<=1;
	for (int i=1;i<=n;++i){
		scanf("%s",s);
		for (int j=1;j<=n;++j) w[i][j]=s[j-1]-'0';
	}
	memset(f,-1,sizeof(f));
	memset(g,-1,sizeof(g));
	LL ans=0;
	for (int i=2;i<=n;++i)
		if (w[1][i]) ans+=dfs1(2,i,n);
	printf("%lld\n",ans);
	return 0;
}