using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int T = int.Parse(Console.ReadLine());
            int[] B = new int[T];
            int[] G = new int[T];
            for (int i = 0; i < T; i++)
            {
                B[i] = int.Parse(Console.ReadLine());
            }
            for (int i = 0; i < T; i++)
            {
                if (B[i] < 10)
                {
                    G[i] = B[i];
                }
                else if (B[i] > 9 && B[i] < 26)
                {
                    G[i] = 10;
                }
                else if (B[i] > 26 && B[i] < 100)
                {
                    G[i] = B[i] / 2 - 1;
                }
                else
                {
                    G[i] = B[i] / 3; 
                }
            }
            for (int i = 0; i < T; i++)
            {
                Console.WriteLine(G[i]);
            }
        }
    }
}