N = "9999"
count = [0] * 10

for ch in N:
    count[int(ch)] += 1

six_nine = count[6] + count[9]
count[6] = (six_nine + 1) // 2
count[9] = 0

print(max(count))

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: