#include using namespace std; const int INF=110; int n,m=5; int d[1010][40]; int mz[1010]; void dfs(int p,int s,int t,int c,int r) { if(p>=m) { if(c>p)&1)==0 && ((t>>p)&3)==0) dfs(p+1,s|(1<>p)&3)==0 && ((t>>p)&3)==0) dfs(p+1,s|(3<>p)&3)==0) dfs(p+1,s|(3<>p)&1)==0 && ((t>>p)&1)==0) dfs(p+1,s|(1<0 && (((s>>p)&1)==0) && (t>>(p-1)&3)==0) dfs(p+1,s|(1<>p)&3)==0 && ((t>>p)&1)==0) dfs(p+1,s|(3<>p)&3)==0 && ((t>>p)&2)==0) dfs(p+1,s|(3<>p)&1)==1) dfs(p+1,s,t,c,r); else dfs(p+1,s|(1<>=1; else { x>>=1; if((x&1)==1) cnt++; x>>=1; i++; } } return cnt; } int main() { int c; while(~scanf("%d%d",&n,&c)) { for(int i=0;i