#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
	int in;
	cin >> in;

	int n = in % 4;
	vector <int> c (4, 0);

	for (int i = 0; i < n; ++i){
		c[i] = 1;
	} // end for

	sort (c.begin(), c.end() );

	int res = 0;
	do{
		++res;
//		for (int i = 0; i < c.size(); ++i){
//			cout << c[i] << ' ';
//		} // end for
		cout << endl;

	}while (next_permutation(c.begin(), c.end() ) );

	cout << res << endl;	
		
	return 0;
}