#define F(a,b)for(a=b;a<101;a++) i;double a,x,t[]={.5,1,1,2,1,2,3,6,1,2,2,4,3,6,12,24,1,3,2,6,2,6,6,18,3,12,6,24,12,60,60,360};main(j,k,l,m){scanf("%lf",&x);F(i,0)F(j,i)F(k,j)F(l,k)if(i+j+k+l==x*4)F(m,97)a+=360/t[(i==j)*16+(j==k)*8+(k==l)*4+m-97]*(m%2?i:1)*(m/99?1:100-l);i=!printf("%.lf",a);}