human
Write me a Python program to find the number of bulbs which are ON at the end of n fluctuations given the following:
I found an interesting problem on https://www.codechef.com/ENNO2020/problems/ENCNOV11:
Being a crewmate in the Among Us game, you will have to solve a task to win against the imposter. 
The task : You are given a certain number of bulbs(Say n) which are initially in OFF position. 
The bulbs are numbered from 1 to n. There will be n current fluctuations in such a way that in the 1st fluctuation all bulbs are toggled, in the 2nd fluctuation every 2nd bulb is toggled, in the 3rd fluctuation every 3rd bulb is toggled and so on.
Your job as a crewmate is to find the number of bulbs which are ON at the end of n fluctuations. But, the imposter has a special power which alerts it when a bulb with a number divisible by 3 is kept ON at the end of n fluctuations. 
So, you will have to switch off the bulbs with numbers divisible by 3 and give the final result to complete the task and win the game.

-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow. 
- Each testcase contains of a single line of input, an integer $n$. 

-----Output:-----
- For each testcase, output a single integer - the number of bulbs that will remain ON after $n$ fluctuations.

-----Constraints :-----
- $1 \leq T \leq 1000$
- $2 \leq n \leq 10^9$

-----Sample Input:-----
2
2
20

-----Sample Output:-----
1

3

I tried it in Python, but could not do it. Can you solve it?
assistant
#Here is Python program to find the number of bulbs which are ON at the end of n fluctuations.

import sys
# import math
from math import gcd
# import re
# from heapq import *
# from collections import defaultdict as dd
# from collections import OrderedDict as odict
# from collections import Counter as cc
# from collections import deque
# sys.setrecursionlimit(10**5)#thsis is must
# mod = 10**9+7; md = 998244353
# m = 2**32
input = lambda: sys.stdin.readline().strip()
inp = lambda: list(map(int,sys.stdin.readline().strip().split()))
# def C(n,r,mod):
#   if r>n:
#       return 0
#   num = den = 1
#   for i in range(r):
#       num = (num*(n-i))%mod
#       den = (den*(i+1))%mod
#   return (num*pow(den,mod-2,mod))%mod
# M = 1000000+1
# pfc = [i for i in range(M+1)]
# def pfcs(M):
#     for i in range(2,M+1):
#         if pfc[i]==i:
#             for j in range(i+i,M+1,i):
#                 if pfc[j]==j:
#                     pfc[j] = i
#     return
#______________________________________________________
for _ in range(int(input())):
    n = int(input())
    ans = 0 
    for i in range(1,n+1):
        d = i*i
        if d>n:
            break
        if d%3!=0:
            ans+=1
    print(ans)