// Arup Guha
// 3/7/2015
// Solution to 2016 UCF HS Problem: The Number Thirty

import java.util.*;

public class thirty {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Process each case.
		for (int loop=0; loop<numCases; loop++) {
			int n = stdin.nextInt();
			System.out.println(n/6);
		}
	}
}