a['~~'],s=2e3,k,n,*p;main(j){for(a[1]=scanf("%d",&n);s--;)for(p=a;++p*p?p[j]=1+*p:0,!p[-j]|p[-j]>*p?p[-j]=1+*p:1))for(k=p-a;k&=k-1;)j++;n=!printf("%d",*p-!*p);}