// Arup Guha
// 9/11/2012
// Solution to 9/9/2012 UCF Individual Contest Problem: Sum

import java.util.*;

public class j {
	
	public static void main(String[] args) {
		
		Scanner stdin = new Scanner(System.in);

		// Store answers in a table, seeding it upto 5, to avoid
		// array out of bounds issues.		
		long[] ans = new long[101];
		ans[0] = 0;
		ans[1] = 0;
		ans[2] = 1;
		ans[3] = 1;
		ans[4] = 1;
		ans[5] = 3;
		
		// Because order matters, this recurrence works - we are
		// just choosing a 2, 3 or 5 as our last number.
		for (int i=6; i<ans.length; i++)
			ans[i] = ans[i-2] + ans[i-3] + ans[i-5];
			
		// Now, we can process each case quickly.
		int numCases = stdin.nextInt();
		for (int i=0; i<numCases; i++) {
			int n = stdin.nextInt();
			System.out.println(ans[n]);
		}
	}
}