Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
count=0
for i in range(N):
    I=i+1
    Istr = str(I)
    if Istr.count("3")>0 and Istr.count("5")>0 and Istr.count("7"):
        if Istr.count("0") == 0 and Istr.count("1") == 0 and Istr.count("2") == 0 and Istr.count("4")==0 and Istr.count("6")==0 and Istr.count("8")==0 and Istr.count("9")==0:
            count+=1
        else:
            pass
print(count)

Fixed submission:
N = int(input())
def shichi(n):
    if int(n) > N:
        return 0
    ret=1 if all(n.count(c)>0 for c in "753") else 0
    for c in "753":
        ret += shichi(n+c)
    return ret
print(shichi("0"))

Buggy python submission (verdict: Runtime Error):
N = int(input())
def dfs(s): # 文字列 s で始まる七五三数の個数
if int(s) > N:
  return 0
  ret = 1 if all(s.count(c) > 0 for c in '753') else 0 # s 自体が七五三数なら +1
  for c in '753':
    ret += dfs(s + c)
    return ret
print(dfs('0'))

Fixed submission:
N = int(input())
def shichi(n):
    if int(n) > N:
        return 0
    ret=1 if all(n.count(c)>0 for c in "753") else 0
    for c in "753":
        ret += shichi(n+c)
    return ret
print(shichi("0"))

Buggy python submission (verdict: Runtime Error):
 N = int(input())

 def dfs(s): # 文字列 s で始まる七五三数の個数
 if int(s) > N:
 return 0
 ret = 1 if all(s.count(c) > 0 for c in '753') else 0 # s 自体が七五三数なら +1
 for c in '753':
 ret += dfs(s + c)
 return ret

 print(dfs('0'))

Fixed submission:
N = int(input())
def shichi(n):
    if int(n) > N:
        return 0
    ret=1 if all(n.count(c)>0 for c in "753") else 0
    for c in "753":
        ret += shichi(n+c)
    return ret
print(shichi("0"))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
i = 1
count = 0
if N <= 777777777:
    while i <= N:
        I = str(i)
        I = list(I)
        if I.count("3")>0 and I.count("5")>0 and I.count("7")>0:
            if I.count("0")+I.count("1")+I.count("2")+I.count("4")+I.count("6")+I.count("8")+I.count("9")==0:
                count+=1
                i+=2
            else:
                i+=2
        else:
            i+=2
    print(count)
else:
    print(26484)

Fixed submission:
N = int(input())
def shichi(n):
    if int(n) > N:
        return 0
    ret=1 if all(n.count(c)>0 for c in "753") else 0
    for c in "753":
        ret += shichi(n+c)
    return ret
print(shichi("0"))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
i = 1
count = 0
if N <= 777777777:
    while i <= N:
        I = str(i)
        I = list(I)
        if I.count("3")>0 and I.count("5")>0 and I.count("7"):
            if I.count("0")==0 and I.count("1")==0 and I.count("2")==0 and I.count("4")==0 and I.count("6")==0 and I.count("8")==0 and I.count("9")==0:
                count+=1
                i+=1
            else:
                i+=1
        else:
            i+=1
    print(count)
else:
    print(26484)

Fixed submission:
N = int(input())
def shichi(n):
    if int(n) > N:
        return 0
    ret=1 if all(n.count(c)>0 for c in "753") else 0
    for c in "753":
        ret += shichi(n+c)
    return ret
print(shichi("0"))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
i = 1
count = 0
while i <= N:
    I = str(i)
    I = list(I)
    if I.count("3")>0 and I.count("5")>0 and I.count("7"):
        if I.count("0")==0 and I.count("1")==0 and I.count("2")==0 and I.count("4")==0 and I.count("6")==0 and I.count("8")==0 and I.count("9")==0:
            count+=1
            i+=1
        else:
            i+=1
    else:
        i+=1
print(count)

Fixed submission:
N = int(input())
def shichi(n):
    if int(n) > N:
        return 0
    ret=1 if all(n.count(c)>0 for c in "753") else 0
    for c in "753":
        ret += shichi(n+c)
    return ret
print(shichi("0"))