#include<stdio.h>
int main(void)
{
	int a,b,c,d,n,N,Na,x,i,sum;
	while(scanf("%d",&n)!=EOF){
	sum=0;
		for(i=0;i<4;i++){
			N=n/4;
			Na=n%4;
			a=N;
			b=N;
			c=N;
			d=N+Na;
			x=a+b+c+d;
			if(x==n){
				sum++;
			}
		}
		printf("%d\n",sum);
	}
	return 0;
}
	