public static void main(String[] args) {

		//to get input N;
		int n = Integer.parseInt(args[0]);
		//tweak here to test different N values

		int sum = 0;
		for (int i = 0; i < space.length; i++) {
			for (int j = 0; j < space[0].length; j++) {
				if (space[i][j] != '0') {
					Move ini = new Move(i, j);
					HashSet<ArrayList<Move>> hs = new HashSet<ArrayList<Move>>();
					ArrayList<Move> list = new ArrayList<Move>();
					// int n = 10;
					int step = 0;
					int num_of_vowels = 0;
					getNum(ini, n, step, num_of_vowels, list, hs);
					sum += hs.size();
				}
			}
		}
		System.out.println(sum);
	}