Buggy python submission (verdict: Runtime Error):
a=[int(input())for _ in[0]*int(input())]
m=a[-1]+1
b=[1]*-~m
x=1
while 2*x*-~x<m:
 y=x
 while 2*x*y+x+y<m:
  b[2*x*y+x+y]=0
  y+=1
 x+=1
print(sum(b[e]for e in a))


Fixed submission:
b=[1]*500000
for i in range(3,999,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
def p(x):
 if x<5*1e5:return b[x]
 x=2*x+1
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
print(sum(p(int(input()))for _ in[0]*int(input())))

Buggy python submission (verdict: Runtime Error):
b=[1]*2**31
for i in range(3,46341,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
print(sum(b[int(input())]for _ in[0]*int(input())))


Fixed submission:
b=[1]*500000
for i in range(3,999,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
def p(x):
 if x<5*1e5:return b[x]
 x=2*x+1
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
print(sum(p(int(input()))for _ in[0]*int(input())))

Buggy python submission (verdict: Runtime Error):
b=[1]*2**31
for i in range(3,100,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
print(sum(b[int(input())]for _ in[0]*int(input())))


Fixed submission:
b=[1]*500000
for i in range(3,999,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
def p(x):
 if x<5*1e5:return b[x]
 x=2*x+1
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
print(sum(p(int(input()))for _ in[0]*int(input())))

Buggy python submission (verdict: Runtime Error):
b=[1]*(2**31)
for i in range(3,100,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
print(sum(b[int(input())]for _ in[0]*int(input())))


Fixed submission:
b=[1]*500000
for i in range(3,999,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
def p(x):
 if x<5*1e5:return b[x]
 x=2*x+1
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
print(sum(p(int(input()))for _ in[0]*int(input())))

Buggy python submission (verdict: Runtime Error):
b=[1]*10000
for i in range(3,100,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
print(sum(b[int(input())]for _ in[0]*int(input())))


Fixed submission:
b=[1]*500000
for i in range(3,999,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
def p(x):
 if x<5*1e5:return b[x]
 x=2*x+1
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
print(sum(p(int(input()))for _ in[0]*int(input())))

Buggy python submission (verdict: Runtime Error):
b=[1]*10000
for i in range(3,100,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
print(sum(b[int(input())]for _ in[0]*int(input())))


Fixed submission:
b=[1]*500000
for i in range(3,999,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
def p(x):
 if x<5*1e5:return b[x]
 x=2*x+1
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
print(sum(p(int(input()))for _ in[0]*int(input())))

Buggy python submission (verdict: Runtime Error):
b=[1]*1000000
for i in range(3,1000,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
print(sum(b[int(input())]for _ in[0]*int(input())))


Fixed submission:
b=[1]*500000
for i in range(3,999,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
def p(x):
 if x<5*1e5:return b[x]
 x=2*x+1
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
print(sum(p(int(input()))for _ in[0]*int(input())))

Buggy python submission (verdict: Runtime Error):
b=[1]*2**16
for i in range(3,2**8,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
print(sum(b[int(input())]for _ in[0]*int(input())))


Fixed submission:
b=[1]*500000
for i in range(3,999,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
def p(x):
 if x<5*1e5:return b[x]
 x=2*x+1
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
print(sum(p(int(input()))for _ in[0]*int(input())))

Buggy python submission (verdict: Runtime Error):
b=[1]*2**32
for i in range(3,2**16,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
print(sum(b[int(input())]for _ in[0]*int(input())))


Fixed submission:
b=[1]*500000
for i in range(3,999,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
def p(x):
 if x<5*1e5:return b[x]
 x=2*x+1
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
print(sum(p(int(input()))for _ in[0]*int(input())))

Buggy python submission (verdict: Runtime Error):
b=[1]*500000
for i in range(3,999,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
def p(x):
 if x<1e6:return b[x]
 x=2*x+1
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
print(sum(p(int(input()))for _ in[0]*int(input())))


Fixed submission:
b=[1]*500000
for i in range(3,999,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
def p(x):
 if x<5*1e5:return b[x]
 x=2*x+1
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
print(sum(p(int(input()))for _ in[0]*int(input())))