Buggy python submission (verdict: Runtime Error):
from itertools import product

N = int(input())
num_list = ["3", "5", "7"]
count = 0

for i in range(2,10):
    for t in product(num_list, repeat=i):
        check = t.count("3")*t.count("5")*t.count("7")
        if int("".join(t)): <= N and check:
            count += 1

print(count)

Fixed submission:
from itertools import product

N = int(input())
num_list = ["3", "5", "7"]
count = 0

for i in range(3, 10):
    for t in (product(num_list, repeat=i)):
        check = t.count("3")*t.count("5")*t.count("7")
        if int("".join(t)) <= N and check:
            count += 1


print(count)

Buggy python submission (verdict: Runtime Error):
from itertools import product

N = int(input())
num_list = ["3", "5", "7"]
count = 0

for i in range(2,10):
    for t in product(num_list, repeat=i):
        check = t.count("3")*t.count("5").t.count("7")
        if int("".join(t)): <= N and check:
            count += 1

print(count)

Fixed submission:
from itertools import product

N = int(input())
num_list = ["3", "5", "7"]
count = 0

for i in range(3, 10):
    for t in (product(num_list, repeat=i)):
        check = t.count("3")*t.count("5")*t.count("7")
        if int("".join(t)) <= N and check:
            count += 1


print(count)

Buggy python submission (verdict: Runtime Error):
from itertools import product

N = int(input())
num_list = ["3", "5", "7"]
count = 0

for i in range(2,10):
    for t in product(num_list, repeat=i):
        check = t.count("3")*t.count("5").t.count("7")
        
        if int("".join(t)): <= N and check:
            count += 1

print(count)

Fixed submission:
from itertools import product

N = int(input())
num_list = ["3", "5", "7"]
count = 0

for i in range(3, 10):
    for t in (product(num_list, repeat=i)):
        check = t.count("3")*t.count("5")*t.count("7")
        if int("".join(t)) <= N and check:
            count += 1


print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
count = 0

for i in range(357, N+1):

    i_str = str(i)

    if i_str[0] != "3" and i_str[0] != "5" and i_str[0] != "7":
        continue
 
    else:
        thr = i_str.count("3")
        fiv = i_str.count("5")
        sev = i_str.count("7")


        if len(i_str) == thr + fiv + sev:
            if thr > 0:
                if fiv > 0:
                    if sev > 0: 
                        count += 1

print(count)

Fixed submission:
from itertools import product

N = int(input())
num_list = ["3", "5", "7"]
count = 0

for i in range(3, 10):
    for t in (product(num_list, repeat=i)):
        check = t.count("3")*t.count("5")*t.count("7")
        if int("".join(t)) <= N and check:
            count += 1


print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
count = 0

for i in range(357, N+1):

    i_str = str(i)

    if i_str[-1] != "3" and i_str[-1] != "5" and i_str[-1] != "7":
        continue
 
    else:
        thr = i_str.count("3")
        fiv = i_str.count("5")
        sev = i_str.count("7")


        if len(i_str) == thr + fiv + sev:
            if thr > 0:
                if fiv > 0:
                    if sev > 0: 
                        count += 1

print(count)


Fixed submission:
from itertools import product

N = int(input())
num_list = ["3", "5", "7"]
count = 0

for i in range(3, 10):
    for t in (product(num_list, repeat=i)):
        check = t.count("3")*t.count("5")*t.count("7")
        if int("".join(t)) <= N and check:
            count += 1


print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
count = 0

for i in range(357, N+1):

    i_str = str(i)
 
    thr = i_str.count("3")
    fiv = i_str.count("5")
    sev = i_str.count("7")


    if len(i_str) == thr + fiv + sev:
        if thr > 0:
             if fiv > 0:
                if sev > 0: 
                    count += 1

print(count)


Fixed submission:
from itertools import product

N = int(input())
num_list = ["3", "5", "7"]
count = 0

for i in range(3, 10):
    for t in (product(num_list, repeat=i)):
        check = t.count("3")*t.count("5")*t.count("7")
        if int("".join(t)) <= N and check:
            count += 1


print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
count = 0

for i in range(357, N+1):
 
    thr = str(i).count("3")
    fiv = str(i).count("5")
    sev = str(i).count("7")


    if len(str(i)) == thr + fiv + sev:
        if thr > 0:
             if fiv > 0:
                if sev > 0: 
                    count += 1

print(count)

Fixed submission:
from itertools import product

N = int(input())
num_list = ["3", "5", "7"]
count = 0

for i in range(3, 10):
    for t in (product(num_list, repeat=i)):
        check = t.count("3")*t.count("5")*t.count("7")
        if int("".join(t)) <= N and check:
            count += 1


print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
count = 0

for i in range(357, N+1):
 
    thr = str(i).count("3")
    fiv = str(i).count("5")
    sev = str(i).count("7")


    if thr > 0 and fiv > 0 and sev > 0 and len(str(i)) == thr + fiv + sev:
        count += 1

print(count)

Fixed submission:
from itertools import product

N = int(input())
num_list = ["3", "5", "7"]
count = 0

for i in range(3, 10):
    for t in (product(num_list, repeat=i)):
        check = t.count("3")*t.count("5")*t.count("7")
        if int("".join(t)) <= N and check:
            count += 1


print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

count = 0

for i in range(N+1):
 
    thr = str(i).count("3")
    fiv = str(i).count("5")
    sev = str(i).count("7")


    if thr > 0 and fiv > 0 and sev > 0 and len(str(i)) == thr + fiv + sev:
        count += 1

print(count)


Fixed submission:
from itertools import product

N = int(input())
num_list = ["3", "5", "7"]
count = 0

for i in range(3, 10):
    for t in (product(num_list, repeat=i)):
        check = t.count("3")*t.count("5")*t.count("7")
        if int("".join(t)) <= N and check:
            count += 1


print(count)