let inpt = readLine()! var ans = inpt.count * 2 ans += inpt.filter{ "0469".contains($0)}.count ans += inpt.filter{ $0 == "8"}.count * 2 ans += 1 print(ans)