#include #include #include #include #include #include #include #include using namespace std; typedef long long i64; int v[] = {2, 4, 9, 16, 25, 64, 289, 729, 1681, 2401, 3481, 4096, 5041, 7921, 10201, 15625, 17161, 27889, 28561, 29929, 65536, 83521, 85849, 146689, 262144, 279841, 458329, 491401, 531441, 552049, 579121, 597529, 683929, 703921, 707281, 734449, 829921}; int main(){ //freopen("data.in", "r", stdin); int T; scanf("%d", &T); for(int t=0; t= a && v[i] <= b)++res; printf("%d\n",res); } return 0; }