qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n = int(input())

a = [0] * 100
b = [0] * 100
ans = 0

for i in range(100):
    a[i] = 2 * i + 1

for i in range(100):
    for j in range(2, 200):
        if a[i] % j == 0:
            b[i] += 1

for k in range(n+1):
    if b[k] == 7:
        ans += 1

print(ans)


Fixed code:
n = int(input())

a = [0] * 100
b = [0] * 100
ans = 0

for i in range(100):
    a[i] = 2 * i + 1

for i in range(100):
    for j in range(2, 200):
        if a[i] % j == 0:
            b[i] += 1

for k in range(100):
    if b[k] == 7 and a[k] <= n:
        ans += 1

print(ans)
Buggy code:
N = int(input())
ans = 0
if N < 105:
  pass
else:
  for i in range(1, N+1):
    cnt = 0
    for j in range(1, N+1):
	    if j % i == 0:
          cnt += 1
    if cnt == 8:
      ans += 1
      
print(ans)  

Fixed code:
N = int(input())
ans = 0
if N < 105:
  pass
else:
  for i in range(105, N+1, 2):
    cnt = 0
    for j in range(1, N+1):
      if i % j == 0:
        cnt += 1
    if cnt == 8:
      ans += 1
      
print(ans)
Buggy code:
N = int(input())
cnt,lcnt = 0,0

for i in range(1,N+1):
  for j in range(1,i+1):
    if i%j == 0:
      cnt += 1
      if cnt == 8:
        lcnt += 1
        cnt = 0
print(lcnt)

Fixed code:
N = int(input())
cnt,lcnt = 0,0

for i in range(1,N+1,2):
	for j in range(1,i+1):
		if i%j == 0:
			cnt += 1
			if cnt == 8:
				lcnt += 1
				cnt = 0
	cnt = 0
print(lcnt)
Buggy code:
import math
def countYakusu(n):
  count = 0
  for i in range(n):
    if n % (i+1) == 0:
      count = count + 1
  return count == 8

N = int(input())
count = 0
for i in range(math.ceil(N/2)):
  count = count + countYakusu(i*2)
print(count)


Fixed code:
import math
def countYakusu(n):
  count = 0
  for i in range(n):
    if n % (i+1) == 0:
      count = count + 1
#      print(n,i+1)
#  if count == 8: print(n)
  return count == 8

N = int(input())
count = 0
for i in range(math.ceil(N/2)):
  count = count + countYakusu(i*2+1)
#  print(i*2+1)
print(count)
Buggy code:
N = int(input())

count = 0
for n in range(1, N+1, 2):
    count_fact = 0
    for i in range(1, n+1):
        if n%i == 0:
            count_fact += 1
    else:
        if count_fact == 8:
            print(n)
            count += 1

print(count)


Fixed code:
N = int(input())

count = 0
for n in range(1, N+1, 2):
    count_fact = 0
    for i in range(1, n+1):
        if n%i == 0:
            count_fact += 1
    else:
        if count_fact == 8:
            count += 1

print(count)
Buggy code:
def factorize(n):
  if n==1:
    return [1]
  i=2
  factors=[1]
  while True:
    if n%i==0:
      factors.append(i)
    if i==n:
      break
    else:
      i+=1
  return factors
      
n=int(input())
nums=[]
for i in range(1,n+1):
  if len(factorize(i))==8:
  	nums.append(i)
print(len(nums))

Fixed code:
def factorize(n):
  factors=[1]
  i=2
  while n>1:
    if n%i==0:
      factors.append(i)
    if i==n:
      break
    else:
      i+=1
  return factors
      
n=int(input())
nums=[]
for i in range(1,n+1):
  if i%2==1:
    if len(factorize(i))==8:
      nums.append(i)
print(len(nums))
Buggy code:
n = int(input())
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

count = 0
for i in range(n+1):
  y = make_divisors(i)
  if len(y) == 8:
    count+=1
print(count)

Fixed code:
n = int(input())
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

count = 0
for i in range(n+1):
  if i%2 != 0:
    y = make_divisors(i)
    if len(y) == 8:
      count+=1
print(count)
Buggy code:
n = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
result = 0

for i in range(1,n+1,2):
    if i > 200:
        break
    print(i)
    if len(make_divisors(i)) == 8:
        result += 1
    

print(result)


Fixed code:
n = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
result = 0

for i in range(1,n+1,2):
    if i > 200:
        break
    #print(i)
    if len(make_divisors(i)) == 8:
        result += 1
    

print(result)
Buggy code:
N = int(input())

res = 0

for i in range(1, N+1, 2):
    count = 0
    for j in range(1, N+1):
        if i % j == 0:
            count += 1
    print(i, count)
    if count == 8:
        print(i)
        res += 1

print(res)

Fixed code:
N = int(input())

ans = 0
for i in range(1, N + 1, 2):
    count = 0
    for j in range(1, i + 1):
        if i % j == 0:
            count += 1
    if count == 8:
        ans += 1

print(ans)
Buggy code:
if __name__ == '__main__':
    #AB = [int(i) for i in input().split()]
    N = int(input())
    n = 0
    for i in range(N):
        k = 0
        for j in range(int(i/2)):
            if i % j == 0:
                k += 1
            if k > 8:
                break
        if k == 8:
            n += 1
    print(n)

Fixed code:
if __name__ == '__main__':
    #AB = [int(i) for i in input().split()]
    N = int(input())
    n = 0
    for i in range(3,N+1,2):
        k = 1
        for j in range(2,i+1):
            if i % j == 0:
                k += 1
            if k > 8:
                break
        if k == 8:
            n += 1
    print(n)
Buggy code:
n = input()

num = int(n)
kisu_array = []
yakusuu_array = []
kazu_list = 0
for i in range(1,num+1):
    if i%2 == 0:
        kisu_array.append(i)

for i in kisu_array:
    for j in range(1,i+1):
        if i% j == 0:
            yakusuu_array.append(i)
            if len(yakusuu_array) == 8:
                kazu_list += 1

print(kazu_list)

Fixed code:
n = input()

num = int(n)
kisu_array = []
yakusuu_array = []
kazu_list = 0
for i in range(1,num+1):
    if i%2 != 0:
        kisu_array.append(i)

for i in kisu_array:
    for j in range(1,i+1):
        if i% j == 0:
            yakusuu_array += "1"

            if len(yakusuu_array) == 8:
                kazu_list += 1
    yakusuu_array = []
                
print(kazu_list)
Buggy code:
n = int(input())

total = 0
for i in range(1, n+1):
  if i%2==0: continue
  cnt = 0
  for j in range(1, j+1):
    if i%j ==0: cnt+=1
  
  if cnt==8:
    total += 1

print(total)

Fixed code:
n = int(input())
 
total = 0
for i in range(1, n+1):
  if i%2==0: continue
  cnt = 0
  for j in range(1, n+1):
    if i%j ==0: cnt+=1
  
  if cnt==8:
    total += 1
 
print(total)
Buggy code:
ans=0
n=int(input())
if n<105:
  print('0')
else:
  for i in range(105,n+1):
    if i%2!=0:
      cnt=0
      for j in range(1,i+1):
        if i%j==0:
          cnt+=1
      if cnt==8:
         ans+=1

print(ans)


Fixed code:
ans=0
n=int(input())
if n<105:
  print('0')
  exit()
else:
  for i in range(105,n+1):
    if i%2!=0:
      cnt=0
      for j in range(1,i+1):
        if i%j==0:
          cnt+=1
      if cnt==8:
         ans+=1

print(ans)
Buggy code:
n = int(input())
ans = 0
for num in range(1, n):
    if num%2 == 1:
        continue
    ls = []
    for i in range(num+1):
        if num%i == 0:
            ls.append(i)
    if len(ls) == 8:
        ans += 1
print(ans)

Fixed code:
n = int(input())
ans = 0
for num in range(1, n+1):
    if num%2 == 0:
        continue
    ls = []
    for i in range(1, num+1):
        if num%i == 0:
            ls.append(i)
    if len(ls) == 8:
        ans += 1
print(ans)
Buggy code:
N = int(input())
ans = 0
for i in range(1, N+1):
  num = 0
  if i%2 == 1:
    for j in range(1, i+1):
      if i%i == 0:
        num += 1
    if num == 8:
      ans += 1
print(ans)

Fixed code:
N = int(input())
ans = 0
c = 0

for i in range(1, N+1, 2):
  for j in range(1, i+1):
    if i % j == 0:
       c += 1
      
  if c == 8:
    ans += 1
  c = 0
    
print(ans)
Buggy code:
def main():
    N = int(input())
    ans = 0
    for i in range(1,N+1):
        div = 0
        for c in range(1,i+1):
            if i%c == 0:
                div = div +1
        if div == 8 and (i%2)==1:
            print(i)
            ans = ans+1
    print(ans)
main()

Fixed code:
def main():
    N = int(input())
    ans = 0
    for i in range(1,N+1):
        div = 0
        for c in range(1,i+1):
            if i%c == 0:
                div = div +1
        if div == 8 and (i%2)==1:
            ans = ans+1
    print(ans)
main()
Buggy code:
n = int(input())
count = 0
ans = 0
j = 1

for i in range(1, n+1, 2):
    while j <= i:
        print(i, j)
        if i % j == 0:
            count += 1
        j += 1
        print(i, j, count)
    if count == 8:
        ans += 1
    count = 0
    j = 1
            
print(ans)

Fixed code:
n = int(input())
count = 0
ans = 0
j = 1

for i in range(1, n+1, 2):
    while j <= i:
        if i % j == 0:
            count += 1
        j += 1
    if count == 8:
        ans += 1
    count = 0
    j = 1
            
print(ans)
Buggy code:
N = int(input())
result = 0
for i in range(1,N+1,2):
    count = 0
    for j in range(1,i,2):
        if i %j ==0:
            count+=1
        
    if count ==8:
        result +=1
print(result)



Fixed code:
N = int(input())
count = 0
for i in range(1,N+1,2):
    temp = 0
    for j in range (1,i+1):
        if i%j == 0:
            temp+=1
    if temp == 8:
        count+=1
print(count)
Buggy code:
N = int(input())
ans = 0
if N < 105:
    print(0)



odd_list = [i for i in range(1, N+1) if i % 2 ==  1]


odd_list2 = [i for i in range(105, N+1) if i % 2 ==  1]

for j in odd_list2:
    c = 0
    for i in odd_list:
        if j % i == 0:
            c += 1
            if c == 8:
                ans += 1
                break

        
print(ans)

Fixed code:
N = int(input())

def aaa(N):
    ans = 0
    if N < 105:
        print(ans)
        return

    odd_list = [i for i in range(1, N+1) if i % 2 ==  1]
    odd_list2 = [i for i in range(105, N+1) if i % 2 ==  1]

    for j in odd_list2:
        c = 0
        for i in odd_list:
            if j % i == 0:
                c += 1
                if c == 8:
                    ans += 1
                    break
    print(ans)
aaa(N)
Buggy code:
N = int(input())

res = 0

for i in range(N)[1::2]:
    div = 0
    for j in range(i+1)[1:]:
        if i % j == 0:
            div += 1
    if div == 8:
        res += 1
        
print(res)


Fixed code:
N = int(input())

res = 0

for i in range(N+1)[1::2]:
    div = 0
    for j in range(i+1)[1:]:
        if i % j == 0:
            div += 1
    if div == 8:
        res += 1

print(res)
Buggy code:
def make_div_list(num):
    div_list=[]
    for i in range(1, int(num**0.5)+1):
        if num%i==0:
            div_list.append(i)
            if i!=num//i:
                div_list.append(num//i)
    
    div_list.sort()
    return div_list

n=int(input())
if n<=106:
    print(1)
else:
    ans=1#105
    for num in range(107, n+1):
        if num%2==1:
            l=make_div_list(num)
            if len(l)==8:
                ans+=1
    print(ans)

Fixed code:
def make_div_list(num):
    div_list=[]
    for i in range(1, int(num**0.5)+1):
        if num%i==0:
            div_list.append(i)
            if i!=num//i:
                div_list.append(num//i)
    
    div_list.sort()
    return div_list

n=int(input())
if n<=104:
    print(0)
else:
    ans=1#105
    for num in range(107, n+1):
        if num%2==1:
            l=make_div_list(num)
            if len(l)==8:
                ans+=1
    print(ans)
Buggy code:
N = int(input())

result = 0


for i in range(1, N+1):
    cnt = 0
    if i % 2 ==0:
        continue
    for x in range(1, N+1):
        if i % x == 0:
            cnt += 1
    print(i)
    print(cnt)
    if cnt == 8:
        result += 1
print(result)

Fixed code:
N = int(input())

result = 0


for i in range(1, N+1):
    cnt = 0
    if i % 2 ==0:
        continue
    for x in range(1, N+1):
        if i % x == 0:
            cnt += 1
    #print(i)
    #print(cnt)
    if cnt == 8:
        result += 1
print(result)
Buggy code:
N = int(input())

def num_p(n):
  r = 0
  for i in range(1,n+1):
    if n % i == 0:
      r += 1
  return r

ans = 0
for i in range(1, N+1):
  if num_p(i) == 8:
    ans += 1
print(ans)

Fixed code:
N = int(input())

def num_p(n):
  r = 0
  for i in range(1,n+1):
    if n % i == 0:
      r += 1
  return r

ans = 0
for i in range(1, N+1, 2):
  if num_p(i) == 8:
    ans += 1
print(ans)
Buggy code:
import numpy as np
from sys import stdinans=0
c=0
N = int(input().rstrip())
for i in range(N):
  c=0
  i+=1
  if i%2==1:
    for j in range(i):
      j+=1
      if i%j==0:
        c+=1
  if c==8:
    ans+=1

print(ans)

Fixed code:
import numpy as np
from sys import stdin
ans=0
c=0
N = int(input().rstrip())
for i in range(N):
  c=0
  i+=1
  if i%2==1:
    for j in range(i):
      j+=1
      if i%j==0:
        c+=1
  if c==8:
    ans+=1

print(ans)
Buggy code:
n=int(input())
cnt=0

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    # divisors.sort()
    return divisors

for i in range(n+1):
  if len(make_divisors(i))==8:
    cnt+=1
print(cnt)


Fixed code:
n=int(input())
cnt=0

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    # divisors.sort()
    return divisors

for i in range(1,n+1,2):
  if len(make_divisors(i))==8:
    cnt+=1
print(cnt)
Buggy code:
n = int(input())
ans=0
for i in range(1,N+1,2):
    a=0
    for j in range(1,i+1,2):
        if i%j==0:
            a+=1
    if a==8:
        ans+=1
print(ans)


Fixed code:
n = int(input())
ans=0
for i in range(1,n+1,2):
    a=0
    for j in range(1,i+1,2):
        if i%j==0:
            a+=1
    if a==8:
        ans+=1
print(ans)
Buggy code:
n = int(input())

ans = 0
for j in range(1,n+1):
  	count = 1
	for i in range(n//2):
    	if n % i == 0:
      		count += 1
        if count >= 8:
          ans +=1
print(ans)

            

Fixed code:
n = int(input())
a = n//2
ans = 0
for j in range(1,n+1):
    count = 0
    for i in range(1,j+1):
        if j % i == 0:
            count += 1
        if count >= 8 and j % 2 == 1:
            ans +=1
print(ans)
Buggy code:
N = int(input())

count = 0
divi_count = 0
for n in range(1, N+1, 2):
    for divi in range(1, n+1):
        if n%divi == 0:
            divi_count += 1
    if divi_count == 8:
        count += 1
print(count)


Fixed code:
N = int(input())

count = 0
for n in range(105, N+1, 2):
    divi_count = 0
    for divi in range(1, n+1, 2):
        if n%divi == 0:
            divi_count += 1
    if divi_count == 8:
        count += 1
print(count)
Buggy code:
N = int(input())
ans = 0
for i in range(1, N+1):
    ans += len([j for j in range(1, i) if i % j == 0]) == 8
print(ans)


Fixed code:
N = int(input())
ans = 0
for i in range(1, N+1, 2):
    ans += len([j for j in range(1, i+1) if i % j == 0]) == 8
print(ans)
Buggy code:
N=int(input())
ans=0
for i in range(N+1):
  count=0
  for j in range(i+1):
    if i%j==0:
      count+=1
  if i%2==1 and count==8:
    ans+=1
print(ans)

Fixed code:
N=int(input())
ans=0
for i in range(1,N+1):
  count=0
  for j in range(1,i+1):
    if i%j==0:
      count+=1
  if i%2==1 and count==8:
    ans+=1
print(ans)
Buggy code:
N=int(input())
if N<=105:
    print(1)
else:
    ans=0
    for n in range(106,N+1):
        K=n//2
        y=0
        for k in range(2,K):
            if n%k==0:
                y+=1
        if y==6:
            ans+=1
    print(ans)

Fixed code:
N=int(input())
if N<105:
    print(0)
elif N==105:
    print(1)
else:
    ans=1
    for n in range(106,N+1):
        if n%2:
            K=n//2
            y=0
            #print(n,K)
            for k in range(2,K+1):
                if n%k==0:
                    y+=1
                    #print(k)
            if y==6:
                #print(n)
                ans+=1
    print(ans)
Buggy code:
N = int(input())

def count_divisors(n):
    count = 0
    for i in range(1, n + 1):
        if n % i == 0:
            count += 1
    return count

ans = 0
for i in range(1, N + 1, 2):
    if count_divisors(i) == 8:
        print(i)
        ans += 1
print(ans)


Fixed code:
N = int(input())
 
def count_divisors(n):
    count = 0
    for i in range(1, n + 1):
        if n % i == 0:
            count += 1
    return count
 
ans = 0
for i in range(1, N + 1, 2):
    if count_divisors(i) == 8:
        ans += 1
print(ans)
Buggy code:
N = int(input())

def divlist(n):
    if n < 1:
        return []
    elif n == 1:
        return [1]
    else:
        div = [1]
        for i in range(2, n // 2 + 1):
            if n % i == 0:
                div.append(i)
        return div


ans = []

for i in range(1,N+1):
    if len(divlist(i)) == 8:
        ans.append(i)

print(len(ans))

Fixed code:
N = int(input())

def divlist(n):
    if n < 1:
        return []
    elif n == 1:
        return [1]
    else:
        div = [1]
        for i in range(2, n + 1):
            if n % i == 0:
                div.append(i)
        return div


ans = []

for i in range(1,N+1):
    if i % 2 == 0:
        pass
    elif len(divlist(i)) == 8:
        ans.append(i)

print(len(ans))
Buggy code:
N=int(input())
ans=0
a=0
for i in range(1,N+1):
    for j in range(1,i+1):
        if i%j==0:
            a+=1
            if i%2==1 and a==8:
                ans+=1

print(ans)

Fixed code:
N=int(input())
ans=0
for i in range(1,N+1,2):
    a=0
    for j in range(1,i+1):
        if i%j==0:
            a+=1
            if a==8:
                ans+=1

print(ans)
Buggy code:
N = int(input())
cnt_all = 0

if N >=106 and N%2 ==1:
    for i in range(1,N+1):
        cnt =0
        for j in range(1,i+1):
            if i%j ==0:
                cnt +=1
        if cnt ==8:
            cnt_all+=1
    print(1+cnt_all)

else:
    print(1)

Fixed code:
N = int(input())
cnt_all = 0

if N >=106:
    for i in range(1,N+1):
        cnt =0
        for j in range(1,i+1):
            if i%j ==0:
                cnt +=1
        if cnt ==8 and i%2 ==1:
            cnt_all+=1
    print(cnt_all)

elif N==105:
    print(1)
else:
    print(0)
Buggy code:
ans = [105,135,165,189,195]
n = input()
if n < 105:
  print(0)
elif n < 135:
  print(1)
elif n < 165:
  print(2)
elif n < 189:
  print(3)
elif n < 195:
  print(4)
else:
  print(5)

Fixed code:
ans = [105,135,165,189]
n = int(input())
if n < 105:
  print(0)
elif n < 135:
  print(1)
elif n < 165:
  print(2)
elif n < 189:
  print(3)
elif n < 195:
  print(4)
else:
  print(5)
Buggy code:
N = int(input())
res = 0
for i in range(1,N+1):
    div_cnt = 0
    for j in range(1,i+1):
        if i%j == 0:
            div_cnt += 1
    if div_cnt == 8:
        res += 1
print(res)

Fixed code:
N = int(input())
res = 0
for i in range(1,N+1):
    div_cnt = 0
    for j in range(1,i+1):
        if i%j == 0:
            div_cnt += 1
    if div_cnt == 8 and i%2 == 1:
        res += 1
print(res)
Buggy code:
def ABC106C(n):
    a = 0
    for i in range(1,n+1):
        if n % i == 0:
            a += 1
    return a

a = 0
for i in range(1,int(input()),2):
    if ABC106C(i)==8:
        a += 1
print(a)

Fixed code:
def ABC106C(n):
    a = 0
    for i in range(1,n+1):
        if n % i == 0:
            a += 1
    return a

a = 0
for i in range(1,int(input())+1,2):
    if ABC106C(i)==8:
        a += 1
print(a)
Buggy code:
def yakusu(m):
  cnt=0
  for i in range(m//2):
    if m%i==0:
      cnt+=1
  return cnt
ans=0
n=int(input())
for j in range(1,n+1):
  if yakusu(j)==8 and n%2!=0:
    ans+=1
print(ans)
               

    

Fixed code:
def yakusu(m):
  cnt=1
  for i in range(1,(m//2)+1):
    if m%i==0:
      cnt+=1
  return cnt
ans=0
n=int(input())
for j in range(1,n+1):
  if yakusu(j)==8 and j%2!=0:
    ans+=1
print(ans)
Buggy code:
n = int(input())
cnt = 0
ans = 0
if n%2==1:
  for i in range(1, n+1):
    for j in range(1, n+1):
      if j%i==0:
        cnt+=1
      if j>i:
        if cnt==8:
          ans+=1

print(ans)

Fixed code:
n = int(input())
ans = 0
for i in range(1, n+1):
  cnt = 0
  if i%2==1:
    for j in range(1, i+1):
      if i%j==0:
        cnt+=1
      if j==i and cnt==8:
        ans+=1

print(ans)
Buggy code:
n = int(input())
ans = 0
for i in range(1,n):
  c = 0
  for j in range(1,n+1,2):
    if j % i == 0:
      c += 1 
      if c == 8:
        ans += 1
print(ans)

Fixed code:
n = int(input())
ans = 0
for i in range(1,n+1,2):
  count = 0
  for j in range(1,i+1):
    if i%j == 0:
      count = count + 1
  if count == 8:
    ans = ans + 1 
print(ans)
Buggy code:
n=int(input())

count=0
ans=0
if n<=104:
    print('0')
else:
    for i in range(105,n+1):
        count=0
        for e in range(1,n+1):
            if i%2==0:
                continue
            elif i%e==0:
                count+=1
        if count==8:
            ans+=1
print(ans)

Fixed code:
n=int(input())

count=0
ans=0
if n<=104:
    ans=0
else:
    for i in range(105,n+1):
        count=0
        for e in range(1,n+1):
            if i%2==0:
                break
            elif i%e==0:
                count+=1
        if count==8:
            ans+=1
print(ans)
Buggy code:
n = int(input())
count = 0

if n < 105:
    count = 0
else:
    for i in range(105, n + 1, 2):
        div_count = 0
        for j in range(1, i + 1):
            if i % j == 0:
                div_count += 1
        if div_count == 8:
            print(i)
            count += 1

print(count)


Fixed code:
n = int(input())
count = 0

if n < 105:
    count = 0
else:
    for i in range(105, n + 1, 2):
        div_count = 0
        for j in range(1, i + 1):
            if i % j == 0:
                div_count += 1
        if div_count == 8:
            count += 1

print(count)
Buggy code:
n = int(input())
cnt = 0
l = []
for i in range(1, n+1):
    if i % 2 == 1:
        for d in (1, i+1):
            if n % i == 0:
                l.append(i)
        if len(l) == 8:
            cnt += 1
print(cnt)

Fixed code:
n = int(input())
cnt = 0
l = []
for i in range(1, n+1):
    if i % 2 == 1:
        for d in range(1, i+1):
            if i % d == 0:
                l.append(d)
                if len(l) == 8:
                    cnt += 1
        l = []
print(cnt)
Buggy code:
def test():
    n = int(input())
    count = 0
    a = []
    for i in range(1,n+1):
        if i % 2 != 0:
            for j in range(1,i+1):
                if i % j == 0:
                    count += 1
        a.append(count)
        count = 0
    print(a)
    print(a.count(8))


if __name__ == "__main__":
    test()


Fixed code:
def test():
    n = int(input())
    count = 0
    a = []
    for i in range(1,n+1):
        if i % 2 != 0:
            for j in range(1,i+1):
                if i % j == 0:
                    count += 1
        a.append(count)
        count = 0
    print(a.count(8))


if __name__ == "__main__":
    test()
Buggy code:
N = int(input())
if N < 105:
  print(0)
elif N < 135:
  print(1)
elif N < 165:
  print(2):
elif N < 189:
  print(3)
elif N < 195:
  print(4)
else:
  print(5)

Fixed code:
n = int(input())
if n < 105:
    print(0)
elif n < 135:
    print(1)
elif n < 165:
    print(2)
elif n<189:
    print(3)
elif n<195:
    print(4)
else:
    print(5)
Buggy code:
N = int(input())

ans = []
for i in range(1, N + 1, 2):
    count = 0
    if i == 105:
        print(105)
    for j in range(1, i // 2 + 1):
        if i % j == 0:
            count += 1
    if count == 7:
        ans.append(1)

print(sum(ans))

Fixed code:
N = int(input())

ans = []
for i in range(1, N + 1, 2):
    count = 0
    for j in range(1, i // 2 + 1):
        if i % j == 0:
            count += 1
    if count == 7:
        ans.append(1)

print(sum(ans))