num = [] 100001.times{ num.push 1 } 100001.times{|i| if i < 2 num[i] = 0 else j = i * 2 while j < num.length num[j] = 0 j += i end end } 100000.times{|i| num[i + 1] += num[i] } t = readline.to_i t.times{ n = readline.to_i puts num[n] }