#include<iostream>
using namespace std;

int kaijo(int n)
{
	if (n==0)
		return 1;
	else
		return n * kaijo(n-1);
}

int permutation(int a,int b)
{
	return kaijo(a) / kaijo(a-b);
}

int combination(int a,int b)
{
	return permutation(a,b) / kaijo(b);
}

int how_much_plus_pair(int n)
{
	return combination(4,n % 4);
}

int main()
{
	int n;
	while(cin >> n)
		cout << how_much_plus_pair(n) << endl;
	return 0;
}