#include using namespace std; bool is_prime(int p){ if(p == 1) return false; for(int i = 2; i <= sqrt(p); i++){ if(p % i == 0) return false; } return true; } int main(){ vector a(100001); int cnt = 0; for(int i = 1; i <= 100000; i++){ if(is_prime(i)) cnt++; a[i] = cnt; } int t; cin >> t; for(int i = 0; i < t; i++){ int n; cin >> n; cout << a[n] << endl; } }